feat(error): use thiserror
for error generation
#187
Annotations
32 warnings
useless conversion to the same type: `std::string::String`:
src/plugins/leetcode.rs#L214
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
|
useless use of `vec!`:
src/plugins/leetcode.rs#L183
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:183:13
|
183 | / vec![
184 | | "query getQuestionDetail($titleSlug: String!) {",
185 | | " question(titleSlug: $titleSlug) {",
186 | | " content",
... |
195 | | "}",
196 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
183 ~ ["query getQuestionDetail($titleSlug: String!) {",
184 + " question(titleSlug: $titleSlug) {",
185 + " content",
186 + " stats",
187 + " codeDefinition",
188 + " sampleTestCase",
189 + " exampleTestcases",
190 + " enableRunCode",
191 + " metaData",
192 + " translatedContent",
193 + " }",
194 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L151
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 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L89
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 + "}"]
|
|
the borrowed expression implements the required traits:
src/config/storage.rs#L68
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
|
useless use of `vec!`:
src/cmds/stat.rs#L84
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
|
length comparison to zero:
src/cmds/pick.rs#L193
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
|
this pattern reimplements `Option::unwrap_or`:
src/cmds/pick.rs#L143
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
|
unnecessary map of the identity function:
src/cmds/pick.rs#L142
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
|
useless conversion to the same type: `std::iter::Copied<clap::parser::ValuesRef<'_, i32>>`:
src/cmds/list.rs#L183
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()
|
|
this `impl` can be derived:
src/cache/mod.rs#L31
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,
|
|
clippy (macOS-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (macOS-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
useless conversion to the same type: `std::string::String`:
src/plugins/leetcode.rs#L214
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
|
useless use of `vec!`:
src/plugins/leetcode.rs#L183
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:183:13
|
183 | / vec![
184 | | "query getQuestionDetail($titleSlug: String!) {",
185 | | " question(titleSlug: $titleSlug) {",
186 | | " content",
... |
195 | | "}",
196 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
183 ~ ["query getQuestionDetail($titleSlug: String!) {",
184 + " question(titleSlug: $titleSlug) {",
185 + " content",
186 + " stats",
187 + " codeDefinition",
188 + " sampleTestCase",
189 + " exampleTestcases",
190 + " enableRunCode",
191 + " metaData",
192 + " translatedContent",
193 + " }",
194 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L151
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 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L89
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 + "}"]
|
|
the borrowed expression implements the required traits:
src/config/storage.rs#L68
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
|
useless use of `vec!`:
src/cmds/stat.rs#L84
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
|
length comparison to zero:
src/cmds/pick.rs#L193
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
|
this pattern reimplements `Option::unwrap_or`:
src/cmds/pick.rs#L143
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
|
unnecessary map of the identity function:
src/cmds/pick.rs#L142
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
|
useless conversion to the same type: `std::iter::Copied<clap::parser::ValuesRef<'_, i32>>`:
src/cmds/list.rs#L183
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()
|
|
this `impl` can be derived:
src/cache/mod.rs#L31
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,
|
|
clippy (ubuntu-latest)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
clippy (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
clippy (ubuntu-latest)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|