clippy
295 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 295 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.83.0 (90b35a623 2024-11-26)
- cargo 1.83.0 (5ffbef321 2024-10-29)
- clippy 0.1.83 (90b35a6 2024-11-26)
Annotations
Check warning on line 341 in crates/genemichaels/src/main.rs
github-actions / clippy
using `clone` on type `FormatConfig` which implements the `Copy` trait
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> crates/genemichaels/src/main.rs:341:22
|
341 | let config = self.config.clone();
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 335 in crates/genemichaels/src/main.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:324:9
|
324 | / return FormatPool {
325 | | log: log.clone(),
326 | | config: config,
327 | | pool: {
... |
334 | | errors: Arc::new(Mutex::new(vec![])),
335 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
324 ~ FormatPool {
325 + log: log.clone(),
326 + config: config,
327 + pool: {
328 + let mut p = threadpool::Builder::new();
329 + if let Some(t) = thread_count {
330 + p = p.num_threads(t);
331 + }
332 + p.build()
333 + },
334 + errors: Arc::new(Mutex::new(vec![])),
335 ~ }
|
Check warning on line 181 in crates/genemichaels/src/main.rs
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
--> crates/genemichaels/src/main.rs:181:38
|
181 | let config = load_config(&log, &[args.config, Some(PathBuf::from(CONFIG_JSON))])?;
| ^^^^ help: change this to: `log`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 166 in crates/genemichaels/src/main.rs
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
--> crates/genemichaels/src/main.rs:166:38
|
166 | let config = load_config(&log, &[args.config, Some(PathBuf::from(CONFIG_JSON))])?;
| ^^^^ help: change this to: `log`
|
= 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 102 in crates/genemichaels/src/main.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:102:21
|
102 | return true;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
102 - return true;
102 + true
|
Check warning on line 107 in crates/genemichaels/src/main.rs
github-actions / clippy
question mark operator is useless here
warning: question mark operator is useless here
--> crates/genemichaels/src/main.rs:93:12
|
93 | return Ok(
| ____________^
94 | | serde_json::from_str(
95 | | &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96 | | .stack_context(log, "Failed to decode file as utf8")?
... |
106 | | ).stack_context(log, "Failed to parse file as json")?,
107 | | );
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
help: try removing question mark and `Ok()`
|
93 ~ return serde_json::from_str(
94 + &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
95 + .stack_context(log, "Failed to decode file as utf8")?
96 + .lines()
97 + .filter(|l| {
98 + if l.trim_start().starts_with("//") {
99 + return false;
100 + }
101 + return true;
102 + })
103 + .collect::<Vec<&str>>()
104 + .join("\n"),
105 ~ ).stack_context(log, "Failed to parse file as json");
|
Check warning on line 87 in crates/genemichaels/src/main.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:87:9
|
87 | return Some(p);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
87 - return Some(p);
87 + Some(p)
|
Check warning on line 107 in crates/genemichaels/src/main.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:93:5
|
93 | / return Ok(
94 | | serde_json::from_str(
95 | | &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96 | | .stack_context(log, "Failed to decode file as utf8")?
... |
106 | | ).stack_context(log, "Failed to parse file as json")?,
107 | | );
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
93 ~ Ok(
94 + serde_json::from_str(
95 + &String::from_utf8(read(path).stack_context(log, "Failed to read config file")?)
96 + .stack_context(log, "Failed to decode file as utf8")?
97 + .lines()
98 + .filter(|l| {
99 + if l.trim_start().starts_with("//") {
100 + return false;
101 + }
102 + return true;
103 + })
104 + .collect::<Vec<&str>>()
105 + .join("\n"),
106 + ).stack_context(log, "Failed to parse file as json")?,
107 ~ )
|
Check warning on line 326 in crates/genemichaels/src/main.rs
github-actions / clippy
redundant field names in struct initialization
warning: redundant field names in struct initialization
--> crates/genemichaels/src/main.rs:326:13
|
326 | config: config,
| ^^^^^^^^^^^^^^ help: replace it with: `config`
|
= 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
Check warning on line 79 in crates/aargvark/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:79:31
|
79 | VarkRet::Ok(v) => return v,
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
79 | VarkRet::Ok(v) => v,
| ~
Check warning on line 66 in crates/aargvark/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:66:13
|
66 | return Ok(VarkRet::Ok(v));
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
66 - return Ok(VarkRet::Ok(v));
66 + Ok(VarkRet::Ok(v))
|
Check warning on line 56 in crates/aargvark/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:51:13
|
51 | / return Ok(VarkRet::Help(VarkRetHelp {
52 | | command: state.command,
53 | | args: state.args,
54 | | consumed_args: state.i,
55 | | builder: builder,
56 | | }));
| |_______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
51 ~ Ok(VarkRet::Help(VarkRetHelp {
52 + command: state.command,
53 + args: state.args,
54 + consumed_args: state.i,
55 + builder: builder,
56 ~ }))
|
Check warning on line 48 in crates/aargvark/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:44:13
|
44 | / return Err(Error {
45 | | command: state.command,
46 | | args: state.args,
47 | | detail: ErrorDetail::Incorrect(state.errors),
48 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
44 ~ Err(Error {
45 + command: state.command,
46 + args: state.args,
47 + detail: ErrorDetail::Incorrect(state.errors),
48 ~ })
|
Check warning on line 41 in crates/aargvark/src/lib.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:37:13
|
37 | / return Err(Error {
38 | | command: state.command,
39 | | args: state.args,
40 | | detail: ErrorDetail::TooLittle,
41 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
37 ~ Err(Error {
38 + command: state.command,
39 + args: state.args,
40 + detail: ErrorDetail::TooLittle,
41 ~ })
|
Check warning on line 448 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:448:9
|
448 | return self.0.as_str();
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
448 - return self.0.as_str();
448 + self.0.as_str()
|
Check warning on line 442 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:442:9
|
442 | return self.0;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
442 - return self.0;
442 + self.0
|
Check warning on line 440 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> crates/aargvark/src/traits_impls.rs:440:1
|
440 | impl Into<String> for NotFlag {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<traits_impls::NotFlag>`
|
440 ~ impl From<NotFlag> for String {
441 ~ fn from(val: NotFlag) -> Self {
442 ~ return val.0;
|
Check warning on line 436 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:436:9
|
436 | return &self.0;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
436 - return &self.0;
436 + &self.0
|
Check warning on line 428 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:428:9
|
428 | return self.0.clone();
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
428 - return self.0.clone();
428 + self.0.clone()
|
Check warning on line 430 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
direct implementation of `ToString`
warning: direct implementation of `ToString`
--> crates/aargvark/src/traits_impls.rs:426:1
|
426 | / impl ToString for NotFlag {
427 | | fn to_string(&self) -> String {
428 | | return self.0.clone();
429 | | }
430 | | }
| |_^
|
= 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 422 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:422:9
|
422 | return HelpPattern(vec![HelpPatternElement::Type("STRING".to_string())]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
422 - return HelpPattern(vec![HelpPatternElement::Type("STRING".to_string())]);
422 + HelpPattern(vec![HelpPatternElement::Type("STRING".to_string())])
|
Check warning on line 418 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:418:9
|
418 | return Ok(NotFlag(s.to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
418 - return Ok(NotFlag(s.to_string()));
418 + Ok(NotFlag(s.to_string()))
|
Check warning on line 402 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:402:9
|
402 | return <Vec<AargvarkKV<K, V>>>::build_help_pattern(state);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
402 - return <Vec<AargvarkKV<K, V>>>::build_help_pattern(state);
402 + <Vec<AargvarkKV<K, V>>>::build_help_pattern(state)
|
Check warning on line 398 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:398:9
|
398 | return state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
398 - return state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect());
398 + state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect())
|
Check warning on line 386 in crates/aargvark/src/traits_impls.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:386:9
|
386 | return HelpPattern(vec![HelpPatternElement::Literal("K=V".to_string())]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
386 - return HelpPattern(vec![HelpPatternElement::Literal("K=V".to_string())]);
386 + HelpPattern(vec![HelpPatternElement::Literal("K=V".to_string())])
|