fix: shell detection message always outputed when generating completi… #176
Annotations
30 warnings
useless conversion to the same type: `std::string::String`:
src/plugins/leetcode.rs#L222
warning: useless conversion to the same type: `std::string::String`
--> src/plugins/leetcode.rs:222:18
|
222 | 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#L191
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:191:13
|
191 | / vec![
192 | | "query getQuestionDetail($titleSlug: String!) {",
193 | | " question(titleSlug: $titleSlug) {",
194 | | " content",
... |
203 | | "}",
204 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
191 ~ ["query getQuestionDetail($titleSlug: String!) {",
192 + " question(titleSlug: $titleSlug) {",
193 + " content",
194 + " stats",
195 + " codeDefinition",
196 + " sampleTestCase",
197 + " exampleTestcases",
198 + " enableRunCode",
199 + " metaData",
200 + " translatedContent",
201 + " }",
202 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L159
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:159:13
|
159 | / vec![
160 | | "query daily {",
161 | | " activeDailyCodingChallengeQuestion {",
162 | | " question {",
... |
166 | | "}",
167 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
159 ~ ["query daily {",
160 + " activeDailyCodingChallengeQuestion {",
161 + " question {",
162 + " questionFrontendId",
163 + " }",
164 + " }",
165 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L97
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:97:13
|
97 | / vec![
98 | | "query getTopicTag($slug: String!) {",
99 | | " topicTag(slug: $slug) {",
100 | | " questions {",
... |
104 | | "}",
105 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
97 ~ ["query getTopicTag($slug: String!) {",
98 + " topicTag(slug: $slug) {",
99 + " questions {",
100 + " questionId",
101 + " }",
102 + " }",
103 + "}"]
|
|
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_borrow
= note: `#[warn(clippy::needless_borrow)]` 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
|
this pattern reimplements `Result::unwrap_or`:
src/cmds/pick.rs#L142
warning: this pattern reimplements `Result::unwrap_or`
--> src/cmds/pick.rs:142:39
|
142 | Some(quesname) => match cache.get_problem_id_from_name(quesname) {
| _______________________________________^
143 | | Ok(p) => p,
144 | | Err(_) => 1,
145 | | },
| |_____________________^ help: replace with: `cache.get_problem_id_from_name(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#L141
warning: unnecessary map of the identity function
--> src/cmds/pick.rs:141:50
|
141 | 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/
|
useless conversion to the same type: `std::string::String`:
src/plugins/leetcode.rs#L222
warning: useless conversion to the same type: `std::string::String`
--> src/plugins/leetcode.rs:222:18
|
222 | 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#L191
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:191:13
|
191 | / vec![
192 | | "query getQuestionDetail($titleSlug: String!) {",
193 | | " question(titleSlug: $titleSlug) {",
194 | | " content",
... |
203 | | "}",
204 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
191 ~ ["query getQuestionDetail($titleSlug: String!) {",
192 + " question(titleSlug: $titleSlug) {",
193 + " content",
194 + " stats",
195 + " codeDefinition",
196 + " sampleTestCase",
197 + " exampleTestcases",
198 + " enableRunCode",
199 + " metaData",
200 + " translatedContent",
201 + " }",
202 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L159
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:159:13
|
159 | / vec![
160 | | "query daily {",
161 | | " activeDailyCodingChallengeQuestion {",
162 | | " question {",
... |
166 | | "}",
167 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
159 ~ ["query daily {",
160 + " activeDailyCodingChallengeQuestion {",
161 + " question {",
162 + " questionFrontendId",
163 + " }",
164 + " }",
165 + "}"]
|
|
useless use of `vec!`:
src/plugins/leetcode.rs#L97
warning: useless use of `vec!`
--> src/plugins/leetcode.rs:97:13
|
97 | / vec![
98 | | "query getTopicTag($slug: String!) {",
99 | | " topicTag(slug: $slug) {",
100 | | " questions {",
... |
104 | | "}",
105 | | ]
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
help: you can use an array directly
|
97 ~ ["query getTopicTag($slug: String!) {",
98 + " topicTag(slug: $slug) {",
99 + " questions {",
100 + " questionId",
101 + " }",
102 + " }",
103 + "}"]
|
|
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_borrow
= note: `#[warn(clippy::needless_borrow)]` 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
|
this pattern reimplements `Result::unwrap_or`:
src/cmds/pick.rs#L142
warning: this pattern reimplements `Result::unwrap_or`
--> src/cmds/pick.rs:142:39
|
142 | Some(quesname) => match cache.get_problem_id_from_name(quesname) {
| _______________________________________^
143 | | Ok(p) => p,
144 | | Err(_) => 1,
145 | | },
| |_____________________^ help: replace with: `cache.get_problem_id_from_name(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#L141
warning: unnecessary map of the identity function
--> src/cmds/pick.rs:141:50
|
141 | 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/
|