Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c8d9f95

Browse files
fix: leetcode list with empty cache
1 parent e3eb5ef commit c8d9f95

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

‎CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v0.2.22
2+
+ Fixed the cache can't update with new added problems
3+
4+
+ Display user friendly errors when pick/edit new added problem.
5+
6+
+ upgrade pyo3
7+
8+
+ fix leetcode list with empty cache
9+
110
## v0.2.21
211

312
+ Make programmable support to be an advanced feature

‎Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ path = "src/bin/lc.rs"
44

55
[package]
66
name = "leetcode-cli"
7-
version = "0.2.21"
7+
version = "0.2.22"
88
authors = ["clearloop <cdr.today@foxmail.com>"]
99
edition = "2018"
1010
description = "Leet your code in command-line."

‎src/cache/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ impl Cache {
9494
}
9595

9696
/// Get problems from cache
97-
///
98-
/// if cache doesn't exist, request a new copy
9997
pub fn get_problems(&self) -> Result<Vec<Problem>, Error> {
10098
Ok(problems.load::<Problem>(&self.conn()?)?)
10199
}

‎src/cmds/list.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ impl Command for ListCommand {
126126
let cache = Cache::new()?;
127127
let mut ps = cache.clone().get_problems()?;
128128

129+
// if cache doesn't exist, request a new copy
129130
if ps.is_empty() {
131+
cache.clone().download_problems()?;
130132
return Self::handler(m);
131133
}
132134

‎src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! **Please make sure you have logined in `leetcode.com` with `chrome`**, more info plz checkout [this](#cookies)
2929
//!
3030
//! ```sh
31-
//! leetcode 0.2.21
31+
//! leetcode 0.2.22
3232
//! May the Code be with You 👻
3333
//!
3434
//! USAGE:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /