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 ff0908a

Browse files
fix: percent length in list
1 parent 3c75098 commit ff0908a

File tree

6 files changed

+16
-4
lines changed

6 files changed

+16
-4
lines changed

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
## v0.2.13
2+
fix percent length panic
3+
4+
## v0.2.12
5+
fix gt || ge || lt || le
6+
17
## v0.2.11
28
added code 14 and transfered `&#ge;``&#le` and `'`.
9+
310
## v0.2.10
411
add code 15
512

‎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.12"
7+
version = "0.2.13"
88
authors = ["clearloop <udtrokia@163.com>"]
99
edition = "2018"
1010
description = "Leet your code in command-line."

‎rustfmt.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tab_spaces = 4

‎src/cache/models.rs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ impl std::fmt::Display for Problem {
9494
_ => level,
9595
};
9696

97+
let mut pct = self.percent.to_string();
98+
if pct.len() < 5 {
99+
pct.push_str(&"0".repeat(5 - pct.len()));
100+
}
97101
write!(
98102
f,
99103
" {} {} [{}] {} {} ({} %)",
@@ -102,7 +106,7 @@ impl std::fmt::Display for Problem {
102106
id,
103107
name,
104108
level,
105-
&self.percent.to_string()[0..5]
109+
&pct[..5]
106110
)
107111
}
108112
}

‎src/cli.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use clap::{App, AppSettings};
1313
pub fn main() -> Result<(), Error> {
1414
let m = App::new("leetcode")
1515
.author("clearloop <udtrokia@163.com>")
16-
.version("0.2.12")
16+
.version("0.2.13")
1717
.about("May the Code be with You 👻")
1818
.subcommands(vec![
1919
DataCommand::usage().display_order(1),

‎src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! **Please make sure you have logined in `leetcode.com` with `chrome`**, more info plz checkout [this](#cookies)
2424
//!
2525
//! ```sh
26-
//! leetcode 0.2.12
26+
//! leetcode 0.2.13
2727
//! clearloop <udtrokia@163.com>
2828
//! May the Code be with You 👻
2929
//!

0 commit comments

Comments
(0)

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