Skip to content

chore(dep): bump the deps group with 9 updates (#156) #206

chore(dep): bump the deps group with 9 updates (#156)

chore(dep): bump the deps group with 9 updates (#156) #206

GitHub Actions / clippy succeeded Jun 2, 2024 in 0s

clippy

15 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 15
Note 0
Help 0

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956e 2024-04-29)

Annotations

Check warning on line 159 in src/plugins/leetcode.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
   --> src/plugins/leetcode.rs:151:13
    |
151 | /             vec![
152 | |                 "query daily {",
153 | |                 "  activeDailyCodingChallengeQuestion {",
154 | |                 "    question {",
...   |
158 | |                 "}",
159 | |             ]
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
    |
151 ~             ["query daily {",
152 +                 "  activeDailyCodingChallengeQuestion {",
153 +                 "    question {",
154 +                 "      questionFrontendId",
155 +                 "    }",
156 +                 "  }",
157 +                 "}"]
    |

Check warning on line 97 in src/plugins/leetcode.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
  --> src/plugins/leetcode.rs:89:13
   |
89 | /             vec![
90 | |                 "query getTopicTag($slug: String!) {",
91 | |                 "  topicTag(slug: $slug) {",
92 | |                 "    questions {",
...  |
96 | |                 "}",
97 | |             ]
   | |_____________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
   |
89 ~             ["query getTopicTag($slug: String!) {",
90 +                 "  topicTag(slug: $slug) {",
91 +                 "    questions {",
92 +                 "      questionId",
93 +                 "    }",
94 +                 "  }",
95 +                 "}"]
   |

Check warning on line 84 in src/cmds/stat.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless use of `vec!`

warning: useless use of `vec!`
  --> src/cmds/stat.rs:84:23
   |
84 |         for (i, l) in vec![(easy, easy_ac), (medium, medium_ac), (hard, hard_ac)]
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[(easy, easy_ac), (medium, medium_ac), (hard, hard_ac)]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
   = note: `#[warn(clippy::useless_vec)]` on by default

Check warning on line 214 in src/plugins/leetcode.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::string::String`

warning: useless conversion to the same type: `std::string::String`
   --> src/plugins/leetcode.rs:214:18
    |
214 |             url: self.conf.sys.urls.graphql.into(),
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `self.conf.sys.urls.graphql`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 41 in src/plugins/chrome.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> src/plugins/chrome.rs:37:1
   |
37 | / impl std::string::ToString for Ident {
38 | |     fn to_string(&self) -> String {
39 | |         format!("LEETCODE_SESSION={};csrftoken={};", self.session, self.csrf)
40 | |     }
41 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 90 in src/helper.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary use of `get(&x.id.to_string()).is_some()`

warning: unnecessary use of `get(&x.id.to_string()).is_some()`
  --> src/helper.rs:90:27
   |
90 |         ps.retain(|x| map.get(&x.id.to_string()).is_some());
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&x.id.to_string())`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
   = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default

Check warning on line 68 in src/config/storage.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
  --> src/config/storage.rs:68:42
   |
68 |         let p = PathBuf::from(root).join(&self.scripts.ok_or(Error::NoneError)?);
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.scripts.ok_or(Error::NoneError)?`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 15 in src/config/cookies.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> src/config/cookies.rs:11:1
   |
11 | / impl std::string::ToString for Cookies {
12 | |     fn to_string(&self) -> String {
13 | |         format!("LEETCODE_SESSION={};csrftoken={};", self.session, self.csrf)
14 | |     }
15 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
   = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 216 in src/cmds/pick.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do

warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
   --> src/cmds/pick.rs:216:38
    |
216 | fn longest_common_subsequence(table: &mut Vec<usize>, text1: &str, text2: &str) -> usize {
    |                                      ^^^^^^^^^^^^^^^ help: change this to: `&mut [usize]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
    = note: `#[warn(clippy::ptr_arg)]` on by default

Check warning on line 207 in src/cmds/pick.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/cmds/pick.rs:207:31
    |
207 |             current_problem = &problem;
    |                               ^^^^^^^^ help: change this to: `problem`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 193 in src/cmds/pick.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

warning: length comparison to zero
   --> src/cmds/pick.rs:193:13
    |
193 |     assert!(problems.len() > 0);
    |             ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!problems.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

Check warning on line 146 in src/cmds/pick.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this pattern reimplements `Option::unwrap_or`

warning: this pattern reimplements `Option::unwrap_or`
   --> src/cmds/pick.rs:143:39
    |
143 |                       Some(quesname) => match closest_named_problem(&problems, quesname) {
    |  _______________________________________^
144 | |                         Some(p) => p,
145 | |                         None => 1,
146 | |                     },
    | |_____________________^ help: replace with: `closest_named_problem(&problems, quesname).unwrap_or(1)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
    = note: `#[warn(clippy::manual_unwrap_or)]` on by default

Check warning on line 142 in src/cmds/pick.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary map of the identity function

warning: unnecessary map of the identity function
   --> src/cmds/pick.rs:142:50
    |
142 |                 match m.get_one::<String>("name").map(|name| name) {
    |                                                  ^^^^^^^^^^^^^^^^^ help: remove the call to `map`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
    = note: `#[warn(clippy::map_identity)]` on by default

Check warning on line 187 in src/cmds/list.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `std::iter::Copied<clap::parser::ValuesRef<'_, i32>>`

warning: useless conversion to the same type: `std::iter::Copied<clap::parser::ValuesRef<'_, i32>>`
   --> src/cmds/list.rs:183:39
    |
183 |               let num_range: Vec<i32> = m
    |  _______________________________________^
184 | |                 .get_many::<i32>("range")
185 | |                 .ok_or(Error::NoneError)?
186 | |                 .copied()
187 | |                 .into_iter()
    | |____________________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `#[warn(clippy::useless_conversion)]` on by default
help: consider removing `.into_iter()`
    |
183 ~             let num_range: Vec<i32> = m
184 +                 .get_many::<i32>("range")
185 +                 .ok_or(Error::NoneError)?
186 +                 .copied()
    |

Check warning on line 35 in src/cache/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/cache/mod.rs:31:1
   |
31 | / impl Default for Run {
32 | |     fn default() -> Self {
33 | |         Run::Submit
34 | |     }
35 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
   = help: remove the manual implementation...
help: ...and instead derive it...
   |
26 + #[derive(Default)]
27 | pub enum Run {
   |
help: ...and mark the default variant
   |
28 ~     #[default]
29 ~     Submit,
   |