Skip to content

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

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

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

GitHub Actions / clippy succeeded Jul 5, 2024 in 0s

clippy

21 warnings

Details

Results

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

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

Annotations

Check warning on line 217 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:204:13
    |
204 | /             vec![
205 | |                 "query getQuestionDetail($titleSlug: String!) {",
206 | |                 "  question(titleSlug: $titleSlug) {",
207 | |                 "    content",
...   |
216 | |                 "}",
217 | |             ]
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
    |
204 ~             ["query getQuestionDetail($titleSlug: String!) {",
205 +                 "  question(titleSlug: $titleSlug) {",
206 +                 "    content",
207 +                 "    stats",
208 +                 "    codeDefinition",
209 +                 "    sampleTestCase",
210 +                 "    exampleTestcases",
211 +                 "    enableRunCode",
212 +                 "    metaData",
213 +                 "    translatedContent",
214 +                 "  }",
215 +                 "}"]
    |

Check warning on line 178 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:170:21
    |
170 | /                     vec![
171 | |                         "query questionOfToday {",
172 | |                         "  todayRecord {",
173 | |                         "    question {",
...   |
177 | |                         "}",
178 | |                     ]
    | |_____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
    |
170 ~                     ["query questionOfToday {",
171 +                         "  todayRecord {",
172 +                         "    question {",
173 +                         "      questionFrontendId",
174 +                         "    }",
175 +                         "  }",
176 +                         "}"]
    |

Check warning on line 162 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:154:21
    |
154 | /                     vec![
155 | |                         "query daily {",
156 | |                         "  activeDailyCodingChallengeQuestion {",
157 | |                         "    question {",
...   |
161 | |                         "}",
162 | |                     ]
    | |_____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
    |
154 ~                     ["query daily {",
155 +                         "  activeDailyCodingChallengeQuestion {",
156 +                         "    question {",
157 +                         "      questionFrontendId",
158 +                         "    }",
159 +                         "  }",
160 +                         "}"]
    |

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 235 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:235:18
    |
235 |             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 56 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:52:1
   |
52 | / impl std::string::ToString for Cookies {
53 | |     fn to_string(&self) -> String {
54 | |         format!("LEETCODE_SESSION={};csrftoken={};", self.session, self.csrf)
55 | |     }
56 | | }
   | |_^
   |
   = 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 32 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:25:1
   |
25 | / impl ToString for LeetcodeSite {
26 | |     fn to_string(&self) -> String {
27 | |         match self {
28 | |             LeetcodeSite::LeetcodeCom => "leetcode.com".to_string(),
...  |
31 | |     }
32 | | }
   | |_^
   |
   = 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,
   |

Check warning on line 105 in src/cache/parser.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `v_obj.get("todayRecord")?.as_array()?.get(0)`

warning: accessing first element with `v_obj.get("todayRecord")?.as_array()?.get(0)`
   --> src/cache/parser.rs:105:17
    |
105 |         None => v_obj.get("todayRecord")?.as_array()?.get(0)?,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v_obj.get("todayRecord")?.as_array()?.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `#[warn(clippy::get_first)]` on by default

Check warning on line 18 in src/cache/parser.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

single-character string constant used as pattern

warning: single-character string constant used as pattern
  --> src/cache/parser.rs:18:45
   |
18 |             None => fid_obj.as_str()?.split(" ").last()?.parse::<i32>().ok()?,
   |                                             ^^^ help: consider using a `char`: `' '`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
   = note: `#[warn(clippy::single_char_pattern)]` on by default

Check warning on line 23 in src/cache/parser.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant field names in struct initialization

warning: redundant field names in struct initialization
  --> src/cache/parser.rs:23:13
   |
23 |             fid: fid,
   |             ^^^^^^^^ help: replace it with: `fid`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
   = note: `#[warn(clippy::redundant_field_names)]` on by default