Fix #119: nofmt comment filtering #218
Annotations
359 warnings
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L409
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:409:17
|
409 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
409 - return Ok(());
409 + Ok(())
|
|
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
crates/genemichaels/src/main.rs#L394
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> crates/genemichaels/src/main.rs:394:22
|
394 | 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
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L377
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:377:9
|
377 | / return FormatPool {
378 | | log: log.clone(),
379 | | config: config,
380 | | pool: {
... |
387 | | errors: Arc::new(Mutex::new(vec![])),
388 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
377 ~ FormatPool {
378 + log: log.clone(),
379 + config: config,
380 + pool: {
381 + let mut p = threadpool::Builder::new();
382 + if let Some(t) = thread_count {
383 + p = p.num_threads(t);
384 + }
385 + p.build()
386 + },
387 + errors: Arc::new(Mutex::new(vec![])),
388 ~ }
|
|
|
unnecessary use of `into_owned`:
crates/genemichaels/src/main.rs#L308
warning: unnecessary use of `into_owned`
--> crates/genemichaels/src/main.rs:308:85
|
308 | ... let entries = match glob::glob(&member.to_string_lossy().into_owned()) {
| ^^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L209
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:209:21
|
209 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
209 - return Ok(());
209 + Ok(())
|
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L205
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:205:21
|
205 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
205 - return Ok(());
205 + Ok(())
|
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L354
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:354:9
|
354 | return Ok(());
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
354 - return Ok(());
354 + Ok(())
|
|
|
enclosing `Ok` and `?` operator are unneeded:
crates/genemichaels/src/main.rs#L111
warning: enclosing `Ok` and `?` operator are unneeded
--> crates/genemichaels/src/main.rs:111:12
|
111 | return Ok(maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()))?);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
help: remove the enclosing `Ok` and `?` operator
|
111 - return Ok(maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()))?);
111 + return maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()));
|
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L111
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:111:5
|
111 | return Ok(maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()))?);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
111 - return Ok(maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()))?);
111 + Ok(maybe_load_almost_jsonc(path)?.context_with("Path does not exist", ea!(path = path.dbg_str()))?)
|
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L104
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:104:17
|
104 | return true;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
104 - return true;
104 + true
|
|
|
enclosing `Ok` and `?` operator are unneeded:
crates/genemichaels/src/main.rs#L98
warning: enclosing `Ok` and `?` operator are unneeded
--> crates/genemichaels/src/main.rs:98:12
|
98 | return Ok(
| ____________^
99 | | serde_json::from_str(
100 | | &String::from_utf8(body).stack_context(log, "Failed to decode JSON file as utf8")?.lines().filter(|l| {
101 | | if l.trim_start().starts_with("//") {
... |
106 | | ).stack_context(log, "Failed to parse JSON file")?,
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: remove the enclosing `Ok` and `?` operator
|
98 ~ return serde_json::from_str(
99 | &String::from_utf8(body).stack_context(log, "Failed to decode JSON file as utf8")?.lines().filter(|l| {
...
104 | }).collect::<Vec<&str>>().join("\n"),
105 ~ ).stack_context(log, "Failed to parse JSON file");
|
|
|
unneeded `return` statement:
crates/genemichaels/src/main.rs#L98
warning: unneeded `return` statement
--> crates/genemichaels/src/main.rs:98:5
|
98 | / return Ok(
99 | | serde_json::from_str(
100 | | &String::from_utf8(body).stack_context(log, "Failed to decode JSON file as utf8")?.lines().filter(|l| {
101 | | if l.trim_start().starts_with("//") {
... |
106 | | ).stack_context(log, "Failed to parse JSON file")?,
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`
|
98 ~ Ok(
99 + serde_json::from_str(
100 + &String::from_utf8(body).stack_context(log, "Failed to decode JSON file as utf8")?.lines().filter(|l| {
101 + if l.trim_start().starts_with("//") {
102 + return false;
103 + }
104 + return true;
105 + }).collect::<Vec<&str>>().join("\n"),
106 + ).stack_context(log, "Failed to parse JSON file")?,
107 ~ )
|
|
|
redundant field names in struct initialization:
crates/genemichaels/src/main.rs#L379
warning: redundant field names in struct initialization
--> crates/genemichaels/src/main.rs:379:13
|
379 | 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
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/aargvark/src/lib.rs#L127
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/aargvark/src/lib.rs:127:82
|
127 | .map(|a| shell_escape::escape(std::borrow::Cow::Borrowed(&a)))
| ^^ help: change this to: `a`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unneeded `return` statement:
crates/aargvark/src/lib.rs#L138
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:138:35
|
138 | 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`
|
138 - VarkRet::Ok(v) => return v,
138 + VarkRet::Ok(v) => v,
|
|
|
unneeded `return` statement:
crates/aargvark/src/lib.rs#L70
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:70:13
|
70 | 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`
|
70 - return Ok(VarkRet::Ok(v));
70 + Ok(VarkRet::Ok(v))
|
|
|
unneeded `return` statement:
crates/aargvark/src/lib.rs#L49
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:49:13
|
49 | / return Ok(VarkRet::Help(VarkRetHelp {
50 | | command: state.command,
51 | | args: state.args,
52 | | consumed_args: state.i,
53 | | builder: builder,
54 | | }));
| |_______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
49 ~ Ok(VarkRet::Help(VarkRetHelp {
50 + command: state.command,
51 + args: state.args,
52 + consumed_args: state.i,
53 + builder: builder,
54 ~ }))
|
|
|
unneeded `return` statement:
crates/aargvark/src/lib.rs#L42
warning: unneeded `return` statement
--> crates/aargvark/src/lib.rs:42:13
|
42 | / return Err(Error {
43 | | command: state.command,
44 | | args: state.args,
45 | | detail: state.errors,
46 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
42 ~ Err(Error {
43 + command: state.command,
44 + args: state.args,
45 + detail: state.errors,
46 ~ })
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L637
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:637:9
|
637 | 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`
|
637 - return self.0.as_str();
637 + self.0.as_str()
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L631
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:631:9
|
631 | return self.0;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
631 - return self.0;
631 + self.0
|
|
|
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#L629
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:629:1
|
629 | 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>`
|
629 ~ impl From<NotFlag> for String {
630 ~ fn from(val: NotFlag) -> Self {
631 ~ return val.0;
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L625
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:625:9
|
625 | return &self.0;
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
625 - return &self.0;
625 + &self.0
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L617
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:617:9
|
617 | return self.0.clone();
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
617 - return self.0.clone();
617 + self.0.clone()
|
|
|
direct implementation of `ToString`:
crates/aargvark/src/traits_impls.rs#L615
warning: direct implementation of `ToString`
--> crates/aargvark/src/traits_impls.rs:615:1
|
615 | / impl ToString for NotFlag {
616 | | fn to_string(&self) -> String {
617 | | return self.0.clone();
618 | | }
619 | | }
| |_^
|
= 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
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L611
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:611:9
|
611 | 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`
|
611 - return HelpPattern(vec![HelpPatternElement::Type("STRING".to_string())]);
611 + HelpPattern(vec![HelpPatternElement::Type("STRING".to_string())])
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L607
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:607:9
|
607 | 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`
|
607 - return Ok(NotFlag(s.to_string()));
607 + Ok(NotFlag(s.to_string()))
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L591
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:591:9
|
591 | 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`
|
591 - return <Vec<AargvarkKV<K, V>>>::build_help_pattern(state);
591 + <Vec<AargvarkKV<K, V>>>::build_help_pattern(state)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L587
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:587:9
|
587 | return state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect(), None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
587 - return state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect(), None);
587 + state.r_ok(res.into_iter().map(|kv| (kv.key, kv.value)).collect(), None)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L576
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:576:9
|
576 | 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`
|
576 - return HelpPattern(vec![HelpPatternElement::Literal("K=V".to_string())]);
576 + HelpPattern(vec![HelpPatternElement::Literal("K=V".to_string())])
|
|
|
useless use of `format!`:
crates/aargvark/src/traits_impls.rs#L562
warning: useless use of `format!`
--> crates/aargvark/src/traits_impls.rs:562:32
|
562 | return state.r_err(format!("Missing value in K=V argument"), Some(K::build_completer(&k)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Missing value in K=V argument".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
|
this `else { if .. }` block can be collapsed:
crates/aargvark/src/traits_impls.rs#L545
warning: this `else { if .. }` block can be collapsed
--> crates/aargvark/src/traits_impls.rs:545:20
|
545 | } else {
| ____________________^
546 | | if c == '\\' {
547 | | escape = true;
548 | | } else if c == '=' {
... |
554 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
545 ~ } else if c == '\\' {
546 + escape = true;
547 + } else if c == '=' {
548 + at_value = true;
549 + break;
550 + } else {
551 + k.push(c);
552 + }
|
|
|
useless conversion to the same type: `std::str::Chars<'_>`:
crates/aargvark/src/traits_impls.rs#L537
warning: useless conversion to the same type: `std::str::Chars<'_>`
--> crates/aargvark/src/traits_impls.rs:537:23
|
537 | let mut res = res.chars().into_iter();
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `res.chars()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L569
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:569:9
|
569 | / return state.r_ok(AargvarkKV {
570 | | key: key,
571 | | value: value,
572 | | }, Some(V::build_completer(&v)));
| |________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
569 ~ state.r_ok(AargvarkKV {
570 + key: key,
571 + value: value,
572 ~ }, Some(V::build_completer(&v)))
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L514
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:514:9
|
514 | return HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
514 - return HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))]);
514 + HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))])
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L510
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:510:9
|
510 | return vark_from_iter(state);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
510 - return vark_from_iter(state);
510 + vark_from_iter(state)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L504
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:504:9
|
504 | return HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
504 - return HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))]);
504 + HelpPattern(vec![HelpPatternElement::Array(T::build_help_pattern(state))])
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L500
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:500:9
|
500 | return vark_from_iter(state);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
500 - return vark_from_iter(state);
500 + vark_from_iter(state)
|
|
|
explicit call to `.into_iter()` in function argument accepting `IntoIterator`:
crates/aargvark/src/traits_impls.rs#L492
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> crates/aargvark/src/traits_impls.rs:492:48
|
492 | return state.r_ok(C::from_iter(out.into_iter()), None);
| ^^^------------
| |
| help: consider removing the `.into_iter()`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/iter/traits/collect.rs:152:21
= 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
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L467
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:467:9
|
467 | / return AargvarkToml {
468 | | value: self.value.clone(),
469 | | source: self.source.clone(),
470 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
467 ~ AargvarkToml {
468 + value: self.value.clone(),
469 + source: self.source.clone(),
470 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L460
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:460:9
|
460 | return pathbuf_completer(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
460 - return pathbuf_completer(arg);
460 + pathbuf_completer(arg)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L447
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:447:9
|
447 | / return HelpPattern(
448 | | vec![
449 | | HelpPatternElement::Variant(
450 | | vec![
... |
455 | | ],
456 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
447 ~ HelpPattern(
448 + vec![
449 + HelpPatternElement::Variant(
450 + vec![
451 + <PathBuf as AargvarkTrait>::build_help_pattern(state),
452 + HelpPattern(vec![HelpPatternElement::Literal("-".to_string())])
453 + ],
454 + )
455 + ],
456 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L442
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:442:23
|
442 | Err(e) => return Err(e.to_string()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
442 ~ Err(e) => Err(e.to_string()),
443 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L438
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:438:22
|
438 | Ok(v) => return Ok(Self {
| ______________________^
439 | | value: v,
440 | | source: b.source,
441 | | }),
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
438 ~ Ok(v) => Ok(Self {
439 + value: v,
440 + source: b.source,
441 ~ }),
442 | Err(e) => return Err(e.to_string()),
443 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L414
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:414:9
|
414 | / return AargvarkYaml {
415 | | value: self.value.clone(),
416 | | source: self.source.clone(),
417 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
414 ~ AargvarkYaml {
415 + value: self.value.clone(),
416 + source: self.source.clone(),
417 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L407
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:407:9
|
407 | return pathbuf_completer(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
407 - return pathbuf_completer(arg);
407 + pathbuf_completer(arg)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L394
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:394:9
|
394 | / return HelpPattern(
395 | | vec![
396 | | HelpPatternElement::Variant(
397 | | vec![
... |
402 | | ],
403 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
394 ~ HelpPattern(
395 + vec![
396 + HelpPatternElement::Variant(
397 + vec![
398 + <PathBuf as AargvarkTrait>::build_help_pattern(state),
399 + HelpPattern(vec![HelpPatternElement::Literal("-".to_string())])
400 + ],
401 + )
402 + ],
403 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L389
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:389:23
|
389 | Err(e) => return Err(e.to_string()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
389 ~ Err(e) => Err(e.to_string()),
390 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L385
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:385:22
|
385 | Ok(v) => return Ok(Self {
| ______________________^
386 | | value: v,
387 | | source: b.source,
388 | | }),
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
385 ~ Ok(v) => Ok(Self {
386 + value: v,
387 + source: b.source,
388 ~ }),
389 | Err(e) => return Err(e.to_string()),
390 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L365
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:365:9
|
365 | / return AargvarkJson {
366 | | value: self.value.clone(),
367 | | source: self.source.clone(),
368 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
365 ~ AargvarkJson {
366 + value: self.value.clone(),
367 + source: self.source.clone(),
368 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L358
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:358:9
|
358 | return pathbuf_completer(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
358 - return pathbuf_completer(arg);
358 + pathbuf_completer(arg)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L345
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:345:9
|
345 | / return HelpPattern(
346 | | vec![
347 | | HelpPatternElement::Variant(
348 | | vec![
... |
353 | | ],
354 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
345 ~ HelpPattern(
346 + vec![
347 + HelpPatternElement::Variant(
348 + vec![
349 + <PathBuf as AargvarkTrait>::build_help_pattern(state),
350 + HelpPattern(vec![HelpPatternElement::Literal("-".to_string())])
351 + ],
352 + )
353 + ],
354 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L340
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:340:23
|
340 | Err(e) => return Err(e.to_string()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
340 ~ Err(e) => Err(e.to_string()),
341 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L336
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:336:22
|
336 | Ok(v) => return Ok(Self {
| ______________________^
337 | | value: v,
338 | | source: b.source,
339 | | }),
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
336 ~ Ok(v) => Ok(Self {
337 + value: v,
338 + source: b.source,
339 ~ }),
340 | Err(e) => return Err(e.to_string()),
341 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L319
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:319:9
|
319 | return pathbuf_completer(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
319 - return pathbuf_completer(arg);
319 + pathbuf_completer(arg)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L306
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:306:9
|
306 | / return HelpPattern(
307 | | vec![
308 | | HelpPatternElement::Variant(
309 | | vec![
... |
314 | | ],
315 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
306 ~ HelpPattern(
307 + vec![
308 + HelpPatternElement::Variant(
309 + vec![
310 + <PathBuf as AargvarkTrait>::build_help_pattern(state),
311 + HelpPattern(vec![HelpPatternElement::Literal("-".to_string())])
312 + ],
313 + )
314 + ],
315 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L300
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:300:27
|
300 | Err(e) => return Err(format!("Error reading {}: {}", s, e)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
300 ~ Err(e) => Err(format!("Error reading {}: {}", s, e)),
301 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L296
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:296:26
|
296 | Ok(v) => return Ok(Self {
| __________________________^
297 | | value: v,
298 | | source: Source::File(PathBuf::from(s)),
299 | | }),
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
296 ~ Ok(v) => Ok(Self {
297 + value: v,
298 + source: Source::File(PathBuf::from(s)),
299 ~ }),
300 | Err(e) => return Err(format!("Error reading {}: {}", s, e)),
301 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L292
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:292:27
|
292 | Err(e) => return Err(format!("Error reading stdin: {}", e)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
292 ~ Err(e) => Err(format!("Error reading stdin: {}", e)),
293 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L288
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:288:26
|
288 | Ok(_) => return Ok(Self {
| __________________________^
289 | | value: out,
290 | | source: Source::Stdin,
291 | | }),
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
288 ~ Ok(_) => Ok(Self {
289 + value: out,
290 + source: Source::Stdin,
291 ~ }),
292 | Err(e) => return Err(format!("Error reading stdin: {}", e)),
293 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L266
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:266:13
|
266 | return out;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
266 - return out;
266 + out
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L259
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:259:9
|
259 | / return Box::new(move || {
260 | | let mut out = vec![];
261 | | for l in BOOL_LITERALS {
262 | | if l.starts_with(&arg) {
... |
266 | | return out;
267 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
259 ~ Box::new(move || {
260 + let mut out = vec![];
261 + for l in BOOL_LITERALS {
262 + if l.starts_with(&arg) {
263 + out.push(vec![l.to_string()]);
264 + }
265 + }
266 + return out;
267 ~ })
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L245
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:245:9
|
245 | / return HelpPattern(
246 | | vec![
247 | | HelpPatternElement::Variant(
248 | | BOOL_LITERALS
... |
253 | | ],
254 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
245 ~ HelpPattern(
246 + vec![
247 + HelpPatternElement::Variant(
248 + BOOL_LITERALS
249 + .iter()
250 + .map(|l| HelpPattern(vec![HelpPatternElement::Literal(l.to_string())]))
251 + .collect(),
252 + )
253 + ],
254 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L241
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:241:9
|
241 | return <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
241 - return <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string());
241 + <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string())
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L230
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:230:9
|
230 | return pathbuf_completer(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
230 - return pathbuf_completer(arg);
230 + pathbuf_completer(arg)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L226
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:226:9
|
226 | return HelpPattern(vec![HelpPatternElement::Type("PATH".to_string())]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
226 - return HelpPattern(vec![HelpPatternElement::Type("PATH".to_string())]);
226 + HelpPattern(vec![HelpPatternElement::Type("PATH".to_string())])
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L222
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:222:9
|
222 | return <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
222 - return <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string());
222 + <Self as std::str::FromStr>::from_str(s).map_err(|e| e.to_string())
|
|
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
crates/genemichaels-lib/src/lib.rs#L578
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> crates/genemichaels-lib/src/lib.rs:578:17
|
578 | config: config.clone(),
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*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
|
|
useless use of `format!`:
crates/aargvark/src/traits_impls.rs#L197
warning: useless use of `format!`
--> crates/aargvark/src/traits_impls.rs:197:26
|
197 | prefix = format!("");
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
|
|
this `.filter_map(..)` can be written more simply using `.map(..)`:
crates/aargvark/src/traits_impls.rs#L186
warning: this `.filter_map(..)` can be written more simply using `.map(..)`
--> crates/aargvark/src/traits_impls.rs:186:24
|
186 | return o.into_iter().filter_map(|x| Some(vec![format!("{}{}", prefix, x)])).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
= note: `#[warn(clippy::unnecessary_filter_map)]` on by default
|
|
useless use of `format!`:
crates/aargvark/src/traits_impls.rs#L177
warning: useless use of `format!`
--> crates/aargvark/src/traits_impls.rs:177:26
|
177 | prefix = format!("");
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
comparison to empty slice:
crates/aargvark/src/traits_impls.rs#L175
warning: comparison to empty slice
--> crates/aargvark/src/traits_impls.rs:175:16
|
175 | if arg == "" {
| ^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `arg.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
= note: `#[warn(clippy::comparison_to_empty)]` on by default
|
|
the borrowed expression implements the required traits:
crates/aargvark/src/traits_impls.rs#L145
warning: the borrowed expression implements the required traits
--> crates/aargvark/src/traits_impls.rs:145:28
|
145 | match read_dir(&p) {
| ^^ help: change this to: `p`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
unneeded late initialization:
crates/aargvark/src/traits_impls.rs#L144
warning: unneeded late initialization
--> crates/aargvark/src/traits_impls.rs:144:13
|
144 | let d;
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: move the declaration `d` here and remove the assignments from the `match` arms
|
144 ~
145 ~ let d = match read_dir(&p) {
146 | Ok(d0) => {
147 ~ d0
148 | },
...
151 | },
152 ~ };
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L163
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:163:13
|
163 | return Some(out);
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
163 - return Some(out);
163 + Some(out)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L216
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:216:9
|
216 | return vec![];
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
216 - return vec![];
216 + vec![]
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L142
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:142:5
|
142 | / return Box::new(move || {
143 | | fn list(p: &Path) -> Option<Vec<String>> {
144 | | let d;
145 | | match read_dir(&p) {
... |
216 | | return vec![];
217 | | });
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
142 ~ Box::new(move || {
143 + fn list(p: &Path) -> Option<Vec<String>> {
144 + let d;
145 + match read_dir(&p) {
146 + Ok(d0) => {
147 + d = d0;
148 + },
149 + Err(_) => {
150 + return None;
151 + },
152 + }
153 + let mut out = vec![];
154 + for e in d {
155 + let Ok(e) = e else {
156 + continue;
157 + };
158 + let Some(n) = e.file_name().to_str().map(|x| x.to_string()) else {
159 + continue;
160 + };
161 + out.push(n);
162 + }
163 + return Some(out);
164 + }
165 +
166 + let path = PathBuf::from(&arg);
167 + let Ok(current_dir) = current_dir() else {
168 + return vec![];
169 + };
170 +
171 + // If dir, list that dir
172 + {
173 + let prefix;
174 + let use_path;
175 + if arg == "" {
176 + use_path = ¤t_dir;
177 + prefix = format!("");
178 + } else if arg.ends_with("/") {
179 + use_path = &path;
180 + prefix = arg.to_string();
181 + } else {
182 + use_path = &path;
183 + prefix = format!("{}/", arg);
184 + }
185 + if let Some(o) = list(use_path) {
186 + return o.into_iter().filter_map(|x| Some(vec![format!("{}{}", prefix, x)])).collect();
187 + }
188 + }
189 +
190 + // Not a dir, so must be a partial filename
191 + {
192 + let parent = path.parent().unwrap().to_path_buf();
193 + let prefix;
194 + let use_path;
195 + if parent.as_os_str().as_encoded_bytes() == b"" {
196 + use_path = ¤t_dir;
197 + prefix = format!("");
198 + } else {
199 + use_path = &parent;
200 + prefix = format!("{}/", parent.to_str().unwrap());
201 + }
202 + if let Some(o) = list(use_path) {
203 + let filter_prefix = path.file_name().unwrap().to_str().unwrap();
204 + let mut out = vec![];
205 + for e in o {
206 + if !e.starts_with(filter_prefix) {
207 + continue;
208 + }
209 + out.push(vec![format!("{}{}", prefix, e)]);
210 + }
211 + return out;
212 + }
213 + }
214 +
215 + // Bad path, give up
216 + return vec![];
217 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L564
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:564:9
|
564 | return Ok(out);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
564 - return Ok(out);
564 + Ok(out)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L558
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:558:9
|
558 | / return Ok(FormatRes {
559 | | rendered: format!("{}{}", shebang, out.rendered),
560 | | lost_comments: out.lost_comments,
561 | | warnings: out.warnings,
562 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
558 ~ Ok(FormatRes {
559 + rendered: format!("{}{}", shebang, out.rendered),
560 + lost_comments: out.lost_comments,
561 + warnings: out.warnings,
562 ~ })
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L84
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:84:9
|
84 | return <T as AargvarkFromStr>::build_help_pattern(state);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
84 - return <T as AargvarkFromStr>::build_help_pattern(state);
84 + <T as AargvarkFromStr>::build_help_pattern(state)
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L66
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:66:17
|
66 | / return HelpPartialProduction {
67 | | description: "".to_string(),
68 | | content: HelpPartialContent::Pattern(<Self as AargvarkTrait>::build_help_pattern(state)),
69 | | };
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
66 ~ HelpPartialProduction {
67 + description: "".to_string(),
68 + content: HelpPartialContent::Pattern(<Self as AargvarkTrait>::build_help_pattern(state)),
69 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L79
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:79:23
|
79 | Err(e) => return state.r_err(e, Some(completer)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
79 - Err(e) => return state.r_err(e, Some(completer)),
79 + Err(e) => state.r_err(e, Some(completer)),
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L77
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:77:17
|
77 | return state.r_ok(v, Some(completer));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
77 - return state.r_ok(v, Some(completer));
77 + state.r_ok(v, Some(completer))
|
|
|
unneeded `return` statement:
crates/aargvark/src/traits_impls.rs#L57
warning: unneeded `return` statement
--> crates/aargvark/src/traits_impls.rs:57:9
|
57 | return empty_completer();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
57 - return empty_completer();
57 + empty_completer()
|
|
|
redundant closure:
crates/aargvark/src/traits.rs#L31
warning: redundant closure
--> crates/aargvark/src/traits.rs:31:21
|
31 | return Box::new(|| vec![]);
| ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::Vec::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
|
unneeded `return` statement:
crates/aargvark/src/traits.rs#L31
warning: unneeded `return` statement
--> crates/aargvark/src/traits.rs:31:5
|
31 | return Box::new(|| vec![]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
31 - return Box::new(|| vec![]);
31 + Box::new(|| vec![])
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L176
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:176:9
|
176 | return std::fmt::Display::fmt(self, f);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
176 - return std::fmt::Display::fmt(self, f);
176 + std::fmt::Display::fmt(self, f)
|
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/base.rs#L163
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/base.rs:163:13
|
163 | text.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/base.rs#L159
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/base.rs:159:13
|
159 | text.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L170
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:170:9
|
170 | return text.fmt(f);
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
170 - return text.fmt(f);
170 + text.fmt(f)
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L124
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:124:9
|
124 | return self.r_err("Missing argument(s), use --help for more info".to_string(), None);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
124 - return self.r_err("Missing argument(s), use --help for more info".to_string(), None);
124 + self.r_err("Missing argument(s), use --help for more info".to_string(), None)
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L117
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:117:9
|
117 | return R::Err;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
117 - return R::Err;
117 + R::Err
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L104
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:104:9
|
104 | return R::Ok(v);
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
104 - return R::Ok(v);
104 + R::Ok(v)
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L83
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:83:9
|
83 | return self.i;
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
83 - return self.i;
83 + self.i
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L78
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:78:9
|
78 | return PeekR::Ok(v);
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
78 - return PeekR::Ok(v);
78 + PeekR::Ok(v)
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L66
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:66:9
|
66 | return self.provide_completions;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
66 - return self.provide_completions;
66 + self.provide_completions
|
|
|
the following explicit lifetimes could be elided: 'a:
crates/aargvark/src/base.rs#L65
warning: the following explicit lifetimes could be elided: 'a
--> crates/aargvark/src/base.rs:65:32
|
65 | pub fn provide_completions<'a>(&'a self) -> bool {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
65 - pub fn provide_completions<'a>(&'a self) -> bool {
65 + pub fn provide_completions(&self) -> bool {
|
|
|
unneeded `return` statement:
crates/aargvark/src/base.rs#L50
warning: unneeded `return` statement
--> crates/aargvark/src/base.rs:50:9
|
50 | / return Self {
51 | | provide_completions: provide_completions,
52 | | command: command,
53 | | args: args,
... |
56 | | errors: vec![],
57 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
50 ~ Self {
51 + provide_completions: provide_completions,
52 + command: command,
53 + args: args,
54 + i: 0,
55 + last_completer: None,
56 + errors: vec![],
57 ~ }
|
|
|
the function `format_content` doesn't need a mutable reference:
crates/aargvark/src/help.rs#L418
warning: the function `format_content` doesn't need a mutable reference
--> crates/aargvark/src/help.rs:418:55
|
418 | format_content(&mut out, &mut temp_stack, &mut help_state, &top.content);
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L413
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:413:13
|
413 | out.push_str(":");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(':')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
the function `format_content` doesn't need a mutable reference:
crates/aargvark/src/help.rs#L401
warning: the function `format_content` doesn't need a mutable reference
--> crates/aargvark/src/help.rs:401:59
|
401 | format_content(&mut out, &mut temp_stack, &mut help_state, content);
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
= note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/aargvark/src/help.rs#L391
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/aargvark/src/help.rs:391:42
|
391 | format_pattern(&mut out, &content);
| ^^^^^^^^ help: change this to: `content`
|
= 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
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L386
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:386:21
|
386 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L379
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:379:13
|
379 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L375
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:375:13
|
375 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
the borrowed expression implements the required traits:
crates/aargvark/src/help.rs#L335
warning: the borrowed expression implements the required traits
--> crates/aargvark/src/help.rs:335:69
|
335 | ... Cell::new(style_description(&format!("(synonym for `{}`)", first_flag)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("(synonym for `{}`)", first_flag)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L478
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:478:29
|
478 | IndentUnit::Tabs => return "\t".repeat(current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
478 - IndentUnit::Tabs => return "\t".repeat(current_indent.0),
478 + IndentUnit::Tabs => "\t".repeat(current_indent.0),
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L477
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:477:31
|
477 | IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
477 - IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
477 + IndentUnit::Spaces => " ".repeat(config.indent_spaces * current_indent.0),
|
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L285
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:285:25
|
285 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L272
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:272:25
|
272 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L267
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:267:25
|
267 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
|
|
the borrowed expression implements the required traits:
crates/aargvark/src/help.rs#L254
warning: the borrowed expression implements the required traits
--> crates/aargvark/src/help.rs:254:29
|
254 | ... &textwrap::Options::with_termwidth().initial_indent(" ").subsequent_indent(" "),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `textwrap::Options::with_termwidth().initial_indent(" ").subsequent_indent(" ")`
|
= 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
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L422
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:422:9
|
422 | return out;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
422 - return out;
422 + out
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L233
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:233:9
|
233 | return (key, out);
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
233 - return (key, out);
233 + (key, out)
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L221
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:221:9
|
221 | return (key, out);
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
221 - return (key, out);
221 + (key, out)
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L206
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:206:9
|
206 | return key;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
206 - return key;
206 + key
|
|
|
accessing first element with `new_segs.get(0)`:
crates/genemichaels-lib/src/lib.rs#L187
warning: accessing first element with `new_segs.get(0)`
--> crates/genemichaels-lib/src/lib.rs:187:21
|
187 | let seg_i = new_segs.get(0).unwrap();
| ^^^^^^^^^^^^^^^ help: try: `new_segs.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L165
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:165:47
|
165 | HelpPatternElement::Variant(i) => return i
| _______________________________________________^
166 | | .iter()
167 | | .map(|x| x.render(stack, state))
168 | | .collect::<Vec<_>>()
169 | | .join(&style_logical(" | ")),
| |____________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
165 ~ HelpPatternElement::Variant(i) => i
166 + .iter()
167 + .map(|x| x.render(stack, state))
168 + .collect::<Vec<_>>()
169 ~ .join(&style_logical(" | ")),
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L164
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:164:45
|
164 | HelpPatternElement::Array(i) => return format!("{}{}", i.render(stack, state), style_logical("[ ...]")),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
164 - HelpPatternElement::Array(i) => return format!("{}{}", i.render(stack, state), style_logical("[ ...]")),
164 + HelpPatternElement::Array(i) => format!("{}{}", i.render(stack, state), style_logical("[ ...]")),
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L158
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:158:46
|
158 | HelpPatternElement::Option(i) => return format!(
| ______________________________________________^
159 | | "{}{}{}",
160 | | style_logical("["),
161 | | i.render(stack, state),
162 | | style_logical("]")
163 | | ),
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
158 ~ HelpPatternElement::Option(i) => format!(
159 + "{}{}{}",
160 + style_logical("["),
161 + i.render(stack, state),
162 + style_logical("]")
163 ~ ),
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L156
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:156:17
|
156 | return style_id(key.as_str())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
156 - return style_id(key.as_str())
156 + style_id(key.as_str())
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L153
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:153:17
|
153 | return style_id(production.id.as_str())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
153 - return style_id(production.id.as_str())
153 + style_id(production.id.as_str())
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L149
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:149:44
|
149 | HelpPatternElement::Type(i) => return style_type(format!("<{}>", i)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
149 - HelpPatternElement::Type(i) => return style_type(format!("<{}>", i)),
149 + HelpPatternElement::Type(i) => style_type(format!("<{}>", i)),
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L148
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:148:47
|
148 | HelpPatternElement::Literal(l) => return style_literal(l),
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
148 - HelpPatternElement::Literal(l) => return style_literal(l),
148 + HelpPatternElement::Literal(l) => style_literal(l),
|
|
|
calling `push_str()` using a single-character string literal:
crates/aargvark/src/help.rs#L118
warning: calling `push_str()` using a single-character string literal
--> crates/aargvark/src/help.rs:118:17
|
118 | out.push_str(" ");
| ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `out.push(' ')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L122
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:122:9
|
122 | return out;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
122 - return out;
122 + out
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L69
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:69:9
|
69 | return HelpPartialContent::Production(HelpProductionType::Enum(Rc::new(RefCell::new(variants))));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
69 - return HelpPartialContent::Production(HelpProductionType::Enum(Rc::new(RefCell::new(variants))));
69 + HelpPartialContent::Production(HelpProductionType::Enum(Rc::new(RefCell::new(variants))))
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L60
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:60:9
|
60 | / return HelpPartialContent::Production(
61 | | HelpProductionType::Struct(Rc::new(RefCell::new(HelpProductionTypeStruct {
62 | | fields: fields,
63 | | flag_fields: optional_fields,
64 | | }))),
65 | | );
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
60 ~ HelpPartialContent::Production(
61 + HelpProductionType::Struct(Rc::new(RefCell::new(HelpProductionTypeStruct {
62 + fields: fields,
63 + flag_fields: optional_fields,
64 + }))),
65 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L35
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:35:5
|
35 | return console::Style::new().bold().apply_to(s.as_ref()).to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
35 - return console::Style::new().bold().apply_to(s.as_ref()).to_string();
35 + console::Style::new().bold().apply_to(s.as_ref()).to_string()
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L31
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:31:5
|
31 | return console::Style::new().dim().apply_to(s.as_ref()).to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
31 - return console::Style::new().dim().apply_to(s.as_ref()).to_string();
31 + console::Style::new().dim().apply_to(s.as_ref()).to_string()
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L27
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:27:5
|
27 | return console::Style::new().magenta().apply_to(s.as_ref()).to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
27 - return console::Style::new().magenta().apply_to(s.as_ref()).to_string();
27 + console::Style::new().magenta().apply_to(s.as_ref()).to_string()
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L23
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:23:5
|
23 | return console::Style::new().blue().dim().apply_to(s.as_ref()).to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
23 - return console::Style::new().blue().dim().apply_to(s.as_ref()).to_string();
23 + console::Style::new().blue().dim().apply_to(s.as_ref()).to_string()
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L19
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:19:5
|
19 | return s.as_ref().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
19 - return s.as_ref().to_string();
19 + s.as_ref().to_string()
|
|
|
unneeded `return` statement:
crates/aargvark/src/help.rs#L15
warning: unneeded `return` statement
--> crates/aargvark/src/help.rs:15:5
|
15 | return s.as_ref().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
15 - return s.as_ref().to_string();
15 + s.as_ref().to_string()
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L732
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:732:25
|
732 | return build_self(out, base_indent);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
732 - return build_self(out, base_indent);
732 + build_self(out, base_indent)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L730
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:730:25
|
730 | return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
730 - return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
730 + new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref())
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_type.rs#L379
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_type.rs:379:37
|
379 | sg.seg(out, &c.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `c.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_type.rs#L128
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_type.rs:128:23
|
128 | node.seg(out, &seg.value().ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `seg.value().ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1222
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1222:29
|
1222 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1217
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1217:29
|
1217 | sg.seg(out, &format!("{}::", x.ident));
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}::", x.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1198
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1198:33
|
1198 | sg.seg(out, &format!("{}: ", n));
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1068
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1068:33
|
1068 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L903
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:903:33
|
903 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L884
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:884:33
|
884 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L851
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:851:33
|
851 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L835
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:835:37
|
835 | sg.seg(out, &format!(" {}", n));
| ^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {}", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L765
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:765:37
|
765 | sg.seg(out, &name.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L691
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:691:33
|
691 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L669
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:669:33
|
669 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L192
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:192:33
|
192 | sg.seg(out, &l.semi_token.to_token_stream());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `l.semi_token.to_token_stream()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L184
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:184:49
|
184 | ... sg.seg(out, &format!(" {} ", t.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {} ", t.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L171
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:171:33
|
171 | sg.seg(out, &format!("{} ", l.let_token.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{} ", l.let_token.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
this loop could be written as a `while let` loop:
crates/genemichaels-lib/src/sg_pat.rs#L70
warning: this loop could be written as a `while let` loop
--> crates/genemichaels-lib/src/sg_pat.rs:70:29
|
70 | / ... loop {
71 | | ... let t = match at.1.as_ref() {
72 | | ... Pat::Tuple(t) => t,
73 | | ... _ => break,
... |
116 | | ... return sg0.build(out);
117 | | ... };
| |_______________________^ help: try: `while let Pat::Tuple(t) = at.1.as_ref() { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L653
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:653:17
|
653 | / return Some(Whitespace {
654 | | loc: w.loc,
655 | | mode: WhitespaceMode::Comment(c),
656 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
653 ~ Some(Whitespace {
654 + loc: w.loc,
655 + mode: WhitespaceMode::Comment(c),
656 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L647
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:647:17
|
647 | / return Some(Whitespace {
648 | | loc: w.loc,
649 | | mode: WhitespaceMode::BlankLines(use_lines),
650 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
647 ~ Some(Whitespace {
648 + loc: w.loc,
649 + mode: WhitespaceMode::BlankLines(use_lines),
650 ~ })
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L612
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:612:41
|
612 | ... sg.seg(out, &l.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `l.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L605
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:605:41
|
605 | ... sg.seg(out, &p.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `p.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L593
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:593:62
|
593 | ... TokenTree::Literal(_) => match p.as_char() {
| ________________________________________________^
594 | | ... ':' => false,
595 | | ... '.' => false,
596 | | ... _ => true,
597 | | ... },
| |_______________________^ help: try: `!matches!(p.as_char(), ':' | '.')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L586
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:586:41
|
586 | ... sg.seg(out, &i.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `i.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/sg_general.rs#L534
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/sg_general.rs:534:76
|
534 | ... TokenTree::Punct(punct) => !is_pull_next_punct(&punct),
| ^^^^^^ help: change this to: `punct`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L530
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:530:21
|
530 | / return match &prev {
531 | | Some(prev) => match prev {
532 | | TokenTree::Group(_) => true,
533 | | TokenTree::Ident(_) | TokenTree::Literal(_) => true,
... |
536 | | None => false,
537 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
530 ~ match &prev {
531 + Some(prev) => match prev {
532 + TokenTree::Group(_) => true,
533 + TokenTree::Ident(_) | TokenTree::Literal(_) => true,
534 + TokenTree::Punct(punct) => !is_pull_next_punct(&punct),
535 + },
536 + None => false,
537 ~ }
|
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:518:28
|
518 | return match p.as_char() {
| ____________________________^
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^ help: try: `matches!(p.as_char(), '.' | '\'' | '$' | '#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:518:21
|
518 | / return match p.as_char() {
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
518 ~ match p.as_char() {
519 + '.' => true,
520 + '\'' => true,
521 + '$' => true,
522 + '#' => true,
523 + _ => false,
524 ~ }
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L885
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:885:33
|
885 | sg.seg(out, &e.op.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `e.op.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L456
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:456:45
|
456 | ... sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L306
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:306:37
|
306 | sg.seg(out, &format!(" '{}", l.ident))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" '{}", l.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L280
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:280:37
|
280 | sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= 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
|
|
accessing first element with `children.get(0)`:
crates/genemichaels-lib/src/sg_expr.rs#L176
warning: accessing first element with `children.get(0)`
--> crates/genemichaels-lib/src/sg_expr.rs:176:48
|
176 | sg.child(build_child(out, base_indent, children.get(0).unwrap()));
| ^^^^^^^^^^^^^^^ help: try: `children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L1011
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:1011:29
|
1011 | unicode_len(&prefix),
| ^^^^^^^ help: change this to: `prefix`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L947
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:947:43
|
947 | Node::InlineCode(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L942
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:942:37
|
942 | Node::Text(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
accessing first element with `x.children.get(0)`:
crates/genemichaels-lib/src/whitespace.rs#L940
warning: accessing first element with `x.children.get(0)`
--> crates/genemichaels-lib/src/whitespace.rs:940:17
|
940 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L895
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:895:24
|
895 | if get_splits(&t).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L887
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:887:24
|
887 | if get_splits(&t).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
accessing first element with `x.children.get(0)`:
crates/genemichaels-lib/src/whitespace.rs#L883
warning: accessing first element with `x.children.get(0)`
--> crates/genemichaels-lib/src/whitespace.rs:883:17
|
883 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.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
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L851
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:851:20
|
851 | match (get_splits(&join_lines(&alt)).first().is_some(), &x.title) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&join_lines(&alt)).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
= note: `#[warn(clippy::unnecessary_first_then_check)]` on by default
|
|
this expression borrows a value the compiler would automatically borrow:
crates/genemichaels-lib/src/whitespace.rs#L657
warning: this expression borrows a value the compiler would automatically borrow
--> crates/genemichaels-lib/src/whitespace.rs:657:70
|
657 | write_forward_breaks(state, &mut s, out, max_len, false, (&text[b..]).to_string(), b, breaks);
| ^^^^^^^^^^^^ help: change this to: `text[b..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression borrows a value the compiler would automatically borrow:
crates/genemichaels-lib/src/whitespace.rs#L642
warning: this expression borrows a value the compiler would automatically borrow
--> crates/genemichaels-lib/src/whitespace.rs:642:17
|
642 | (&text[found.writable..]).to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `text[found.writable..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L595
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:595:40
|
595 | state.line_buffer.push_str(&text);
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
redundant field names in struct initialization:
crates/aargvark/src/lib.rs#L53
warning: redundant field names in struct initialization
--> crates/aargvark/src/lib.rs:53:17
|
53 | builder: builder,
| ^^^^^^^^^^^^^^^^ help: replace it with: `builder`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L580
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:580:50
|
580 | writable: if width + unicode_len(&text) > max_len {
| ^^^^^ help: change this to: `text`
|
= 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
|
|
redundant field names in struct initialization:
crates/aargvark/src/traits_impls.rs#L571
warning: redundant field names in struct initialization
--> crates/aargvark/src/traits_impls.rs:571:13
|
571 | value: value,
| ^^^^^^^^^^^^ help: replace it with: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/traits_impls.rs#L570
warning: redundant field names in struct initialization
--> crates/aargvark/src/traits_impls.rs:570:13
|
570 | key: key,
| ^^^^^^^^ help: replace it with: `key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L579
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:579:13
|
579 | / return FoundWritableLen {
580 | | writable: if width + unicode_len(&text) > max_len {
581 | | writable
582 | | } else {
... |
586 | | next_break: None,
587 | | };
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
579 ~ FoundWritableLen {
580 + writable: if width + unicode_len(&text) > max_len {
581 + writable
582 + } else {
583 + text.len()
584 + },
585 + previous_break: previous_break,
586 + next_break: None,
587 ~ }
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L660
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:660:13
|
660 | return;
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
659 - state.line_buffer.push_str(text);
660 - return;
659 + state.line_buffer.push_str(text);
|
|
|
redundant field names in struct initialization:
crates/aargvark/src/base.rs#L53
warning: redundant field names in struct initialization
--> crates/aargvark/src/base.rs:53:13
|
53 | args: args,
| ^^^^^^^^^^ help: replace it with: `args`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/base.rs#L52
warning: redundant field names in struct initialization
--> crates/aargvark/src/base.rs:52:13
|
52 | command: command,
| ^^^^^^^^^^^^^^^^ help: replace it with: `command`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/base.rs#L51
warning: redundant field names in struct initialization
--> crates/aargvark/src/base.rs:51:13
|
51 | provide_completions: provide_completions,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `provide_completions`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/help.rs#L204
warning: redundant field names in struct initialization
--> crates/aargvark/src/help.rs:204:13
|
204 | content: content,
| ^^^^^^^^^^^^^^^^ help: replace it with: `content`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/help.rs#L202
warning: redundant field names in struct initialization
--> crates/aargvark/src/help.rs:202:13
|
202 | id: id,
| ^^^^^^ help: replace it with: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/help.rs#L198
warning: redundant field names in struct initialization
--> crates/aargvark/src/help.rs:198:13
|
198 | type_id: type_id,
| ^^^^^^^^^^^^^^^^ help: replace it with: `type_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/aargvark/src/help.rs#L62
warning: redundant field names in struct initialization
--> crates/aargvark/src/help.rs:62:17
|
62 | fields: fields,
| ^^^^^^^^^^^^^^ help: replace it with: `fields`
|
= 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
|
|
called `skip(..).next()` on an iterator:
crates/genemichaels-lib/src/whitespace.rs#L406
warning: called `skip(..).next()` on an iterator
--> crates/genemichaels-lib/src/whitespace.rs:406:48
|
406 | source = source.lines().skip(e.span().start().line - 1).next().unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(e.span().start().line - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
= note: `#[warn(clippy::iter_skip_next)]` on by default
|
|
calling `push_str()` using a single-character string literal:
crates/genemichaels-lib/src/whitespace.rs#L284
warning: calling `push_str()` using a single-character string literal
--> crates/genemichaels-lib/src/whitespace.rs:284:25
|
284 | previous_comment.lines.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `previous_comment.lines.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
|
use of `or_insert` to construct default value:
crates/genemichaels-lib/src/whitespace.rs#L265
warning: use of `or_insert` to construct default value
--> crates/genemichaels-lib/src/whitespace.rs:265:79
|
265 | let whitespaces = self.whitespaces.entry(HashLineColumn(end)).or_insert(vec![]);
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
|
useless conversion to the same type: `&str`:
crates/genemichaels-lib/src/whitespace.rs#L208
warning: useless conversion to the same type: `&str`
--> crates/genemichaels-lib/src/whitespace.rs:208:65
|
208 | ... buffer.add(CommentMode::Normal, "".into());
| ^^^^^^^^^ help: consider removing `.into()`: `""`
|
= 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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L42
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:42:9
|
42 | return Some(self.0.cmp(&other.0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
42 - return Some(self.0.cmp(&other.0));
42 + Some(self.0.cmp(&other.0))
|
|
|
non-canonical implementation of `partial_cmp` on an `Ord` type:
crates/genemichaels-lib/src/whitespace.rs#L40
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> crates/genemichaels-lib/src/whitespace.rs:40:1
|
40 | / impl PartialOrd for HashLineColumn {
41 | | fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
| | _______________________________________________________________________-
42 | || return Some(self.0.cmp(&other.0));
43 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
44 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
= note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L36
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:36:9
|
36 | return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
36 - return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
36 + self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column))
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L720
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:720:5
|
720 | / return match gen_impl(parse_macro_input!(input as DeriveInput)) {
721 | | Ok(x) => x,
722 | | Err(e) => e.to_compile_error(),
723 | | }.into();
| |____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
720 ~ match gen_impl(parse_macro_input!(input as DeriveInput)) {
721 + Ok(x) => x,
722 + Err(e) => e.to_compile_error(),
723 ~ }.into()
|
|
|
unneeded late initialization:
crates/aargvark_proc_macros/src/lib.rs#L625
warning: unneeded late initialization
--> crates/aargvark_proc_macros/src/lib.rs:625:17
|
625 | let help_variant_pattern;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: move the declaration `help_variant_pattern` here and remove the assignments from the branches
|
625 ~
626 ~ let help_variant_pattern = if type_attr.break_help || variant_vark_attr.break_help {
627 ~ quote!(a::HelpPattern(vec![a::HelpPatternElement::PseudoReference("...".to_string())]))
628 | } else {
629 ~ partial_help_variant_pattern
630 ~ };
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L697
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:697:5
|
697 | / return Ok(quote!{
698 | | impl #decl_generics aargvark:: traits:: AargvarkTrait for #ident #forward_generics {
699 | | fn vark(state:& mut aargvark:: base:: VarkState) -> aargvark:: base:: R < #ident #forward_generics > {
700 | | mod a {
... |
715 | | });
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
697 ~ Ok(quote!{
698 + impl #decl_generics aargvark:: traits:: AargvarkTrait for #ident #forward_generics {
699 + fn vark(state:& mut aargvark:: base:: VarkState) -> aargvark:: base:: R < #ident #forward_generics > {
700 + mod a {
701 + pub use aargvark::help::*;
702 + pub use aargvark::base::*;
703 + pub use aargvark::traits::*;
704 + }
705 + #impl_vark
706 + }
707 + fn build_help_pattern(state:& mut aargvark:: help:: HelpState) -> aargvark:: help:: HelpPattern {
708 + mod a {
709 + pub use aargvark::help::*;
710 + pub use aargvark::traits::*;
711 + }
712 + #impl_help_build
713 + }
714 + }
715 ~ })
|
|
|
unneeded late initialization:
crates/aargvark_proc_macros/src/lib.rs#L330
warning: unneeded late initialization
--> crates/aargvark_proc_macros/src/lib.rs:330:21
|
330 | let field_help_pattern;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: move the declaration `field_help_pattern` here and remove the assignments from the branches
|
330 ~
331 ~ let field_help_pattern = if type_break_help || field_vark_attr.break_help {
332 ~ quote!(a::HelpPattern(vec![]))
333 | }
334 | else {
335 ~ gen.help_pattern
336 ~ };
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L533
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:533:13
|
533 | / return Ok(GenRec {
534 | | vark: quote!{
535 | | state.r_ok(#ident, None)
536 | | },
... |
539 | | },
540 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
533 ~ Ok(GenRec {
534 + vark: quote!{
535 + state.r_ok(#ident, None)
536 + },
537 + help_pattern: quote!{
538 + a::HelpPattern(vec![])
539 + },
540 ~ })
541 | },
542 ~ }
|
|
|
manual implementation of an assign operation:
crates/aargvark_proc_macros/src/lib.rs#L136
warning: manual implementation of an assign operation
--> crates/aargvark_proc_macros/src/lib.rs:136:17
|
136 | placeholder_i = placeholder_i / 27;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `placeholder_i /= 27`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
= note: `#[warn(clippy::assign_op_pattern)]` on by default
|
|
casting a character literal to `u8` truncates:
crates/aargvark_proc_macros/src/lib.rs#L132
warning: casting a character literal to `u8` truncates
--> crates/aargvark_proc_macros/src/lib.rs:132:35
|
132 | placeholder.push((('A' as u8) + (placeholder_i % 27) as u8) as char);
| ^^^^^^^^^^^ help: use a byte literal instead: `b'A'`
|
= note: `char` is four bytes wide, but `u8` is a single byte
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8
= note: `#[warn(clippy::char_lit_as_u8)]` on by default
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L162
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:162:5
|
162 | / return GenRec {
163 | | vark: quote!{
164 | | loop {
165 | | #(#parse_positional) *
... |
194 | | },
195 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
162 ~ GenRec {
163 + vark: quote!{
164 + loop {
165 + #(#parse_positional) *
166 + //. .
167 + break state.r_ok(#ident(#(#copy_fields), *), None);
168 + }
169 + },
170 + help_pattern: if fields.is_empty() {
171 + quote!{
172 + a::HelpPattern(vec![])
173 + }
174 + } else if help_unit_transparent {
175 + help_field_patterns.pop().unwrap()
176 + } else {
177 + quote!{
178 + {
179 + let(
180 + key,
181 + struct_
182 + ) = state.add_struct(
183 + std:: any:: TypeId:: of::< #parent_ident >(),
184 + #subtype_index,
185 + #help_placeholder,
186 + #help_docstr
187 + );
188 + let mut struct_ = struct_.as_ref().borrow_mut();
189 + #(#help_fields) *
190 + //. .
191 + a:: HelpPattern(vec![a::HelpPatternElement::Reference(key)])
192 + }
193 + }
194 + },
195 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L96
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:96:13
|
96 | / return gen_impl_unnamed(
97 | | path,
98 | | ty.to_token_stream(),
99 | | quote!(),
... |
103 | | t.elems.iter().map(|e| (FieldAttr::default(), String::new(), e)).collect::<Vec<_>>().as_slice(),
104 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
96 ~ gen_impl_unnamed(
97 + path,
98 + ty.to_token_stream(),
99 + quote!(),
100 + "TUPLE",
101 + "",
102 + 0,
103 + t.elems.iter().map(|e| (FieldAttr::default(), String::new(), e)).collect::<Vec<_>>().as_slice(),
104 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L86
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:86:13
|
86 | / return GenRec {
87 | | vark: quote!{
88 | | < #t >:: vark(state)
89 | | },
... |
92 | | },
93 | | };
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
86 ~ GenRec {
87 + vark: quote!{
88 + < #t >:: vark(state)
89 + },
90 + help_pattern: quote!{
91 + < #t as a:: AargvarkTrait >:: build_help_pattern(state)
92 + },
93 ~ }
|
|
|
unneeded late initialization:
crates/aargvark_proc_macros/src/lib.rs#L625
warning: unneeded late initialization
--> crates/aargvark_proc_macros/src/lib.rs:625:17
|
625 | let help_variant_pattern;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: move the declaration `help_variant_pattern` here and remove the assignments from the branches
|
625 ~
626 ~ let help_variant_pattern = if type_attr.break_help || variant_vark_attr.break_help {
627 ~ quote!(a::HelpPattern(vec![a::HelpPatternElement::PseudoReference("...".to_string())]))
628 | } else {
629 ~ partial_help_variant_pattern
630 ~ };
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L697
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:697:5
|
697 | / return Ok(quote!{
698 | | impl #decl_generics aargvark:: traits:: AargvarkTrait for #ident #forward_generics {
699 | | fn vark(state:& mut aargvark:: base:: VarkState) -> aargvark:: base:: R < #ident #forward_generics > {
700 | | mod a {
... |
715 | | });
| |______^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
697 ~ Ok(quote!{
698 + impl #decl_generics aargvark:: traits:: AargvarkTrait for #ident #forward_generics {
699 + fn vark(state:& mut aargvark:: base:: VarkState) -> aargvark:: base:: R < #ident #forward_generics > {
700 + mod a {
701 + pub use aargvark::help::*;
702 + pub use aargvark::base::*;
703 + pub use aargvark::traits::*;
704 + }
705 + #impl_vark
706 + }
707 + fn build_help_pattern(state:& mut aargvark:: help:: HelpState) -> aargvark:: help:: HelpPattern {
708 + mod a {
709 + pub use aargvark::help::*;
710 + pub use aargvark::traits::*;
711 + }
712 + #impl_help_build
713 + }
714 + }
715 ~ })
|
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L888
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:888:9
|
888 | warnings: warnings,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `warnings`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L886
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:886:9
|
886 | rendered: rendered,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `rendered`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L585
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:585:17
|
585 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L573
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:573:25
|
573 | next_break: next_break,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L572
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:572:25
|
572 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`:
crates/genemichaels-lib/src/lib.rs#L5
warning: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
--> crates/genemichaels-lib/src/lib.rs:5:5
|
5 | clippy::derive_hash_xor_eq
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L533
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:533:13
|
533 | / return Ok(GenRec {
534 | | vark: quote!{
535 | | state.r_ok(#ident, None)
536 | | },
... |
539 | | },
540 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
533 ~ Ok(GenRec {
534 + vark: quote!{
535 + state.r_ok(#ident, None)
536 + },
537 + help_pattern: quote!{
538 + a::HelpPattern(vec![])
539 + },
540 ~ })
541 | },
542 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L520
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:520:13
|
520 | / return Ok(
521 | | gen_impl_unnamed(
522 | | &ident.to_string(),
523 | | parent_ident,
... |
529 | | ),
530 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
520 ~ Ok(
521 + gen_impl_unnamed(
522 + &ident.to_string(),
523 + parent_ident,
524 + ident.to_token_stream(),
525 + help_placeholder,
526 + help_docstr,
527 + subtype_index,
528 + &fields,
529 + ),
530 ~ )
531 | },
...
541 | },
542 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L494
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:494:13
|
494 | / return Ok(GenRec {
495 | | vark: vark,
496 | | help_pattern: quote!{
... |
512 | | },
513 | | });
| |______________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
494 ~ Ok(GenRec {
495 + vark: vark,
496 + help_pattern: quote!{
497 + {
498 + let(
499 + key,
500 + struct_
501 + ) = state.add_struct(
502 + std::any::TypeId::of::<Self>(),
503 + #subtype_index,
504 + #help_placeholder,
505 + #help_docstr
506 + );
507 + let mut struct_ = struct_.as_ref().borrow_mut();
508 + #(#help_fields) *
509 + //. .
510 + a:: HelpPattern(vec![a::HelpPatternElement::Reference(key)])
511 + }
512 + },
513 ~ })
514 | },
...
541 | },
542 ~ }
|
|
|
this function has too many arguments (9/7):
crates/aargvark_proc_macros/src/lib.rs#L227
warning: this function has too many arguments (9/7)
--> crates/aargvark_proc_macros/src/lib.rs:227:1
|
227 | / fn gen_impl_struct(
228 | | parent_ident: TokenStream,
229 | | ident: TokenStream,
230 | | decl_generics: &TokenStream,
... |
236 | | d: &Fields,
237 | | ) -> Result<GenRec, syn::Error> {
| |_______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
|
manual implementation of an assign operation:
crates/aargvark_proc_macros/src/lib.rs#L136
warning: manual implementation of an assign operation
--> crates/aargvark_proc_macros/src/lib.rs:136:17
|
136 | placeholder_i = placeholder_i / 27;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `placeholder_i /= 27`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
= note: `#[warn(clippy::assign_op_pattern)]` on by default
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L162
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:162:5
|
162 | / return GenRec {
163 | | vark: quote!{
164 | | loop {
165 | | #(#parse_positional) *
... |
194 | | },
195 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
162 ~ GenRec {
163 + vark: quote!{
164 + loop {
165 + #(#parse_positional) *
166 + //. .
167 + break state.r_ok(#ident(#(#copy_fields), *), None);
168 + }
169 + },
170 + help_pattern: if fields.is_empty() {
171 + quote!{
172 + a::HelpPattern(vec![])
173 + }
174 + } else if help_unit_transparent {
175 + help_field_patterns.pop().unwrap()
176 + } else {
177 + quote!{
178 + {
179 + let(
180 + key,
181 + struct_
182 + ) = state.add_struct(
183 + std:: any:: TypeId:: of::< #parent_ident >(),
184 + #subtype_index,
185 + #help_placeholder,
186 + #help_docstr
187 + );
188 + let mut struct_ = struct_.as_ref().borrow_mut();
189 + #(#help_fields) *
190 + //. .
191 + a:: HelpPattern(vec![a::HelpPatternElement::Reference(key)])
192 + }
193 + }
194 + },
195 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L96
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:96:13
|
96 | / return gen_impl_unnamed(
97 | | path,
98 | | ty.to_token_stream(),
99 | | quote!(),
... |
103 | | t.elems.iter().map(|e| (FieldAttr::default(), String::new(), e)).collect::<Vec<_>>().as_slice(),
104 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
96 ~ gen_impl_unnamed(
97 + path,
98 + ty.to_token_stream(),
99 + quote!(),
100 + "TUPLE",
101 + "",
102 + 0,
103 + t.elems.iter().map(|e| (FieldAttr::default(), String::new(), e)).collect::<Vec<_>>().as_slice(),
104 ~ )
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L86
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:86:13
|
86 | / return GenRec {
87 | | vark: quote!{
88 | | < #t >:: vark(state)
89 | | },
... |
92 | | },
93 | | };
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
86 ~ GenRec {
87 + vark: quote!{
88 + < #t >:: vark(state)
89 + },
90 + help_pattern: quote!{
91 + < #t as a:: AargvarkTrait >:: build_help_pattern(state)
92 + },
93 ~ }
|
|
|
unneeded `return` statement:
crates/aargvark_proc_macros/src/lib.rs#L75
warning: unneeded `return` statement
--> crates/aargvark_proc_macros/src/lib.rs:75:5
|
75 | return out.trim().to_string();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
75 - return out.trim().to_string();
75 + out.trim().to_string()
|
|
|
redundant field names in struct initialization:
crates/aargvark_proc_macros/src/lib.rs#L495
warning: redundant field names in struct initialization
--> crates/aargvark_proc_macros/src/lib.rs:495:17
|
495 | vark: vark,
| ^^^^^^^^^^ help: replace it with: `vark`
|
= 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
|
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
crates/genemichaels-lib/src/lib.rs#L578
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> crates/genemichaels-lib/src/lib.rs:578:17
|
578 | config: config.clone(),
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L564
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:564:9
|
564 | return Ok(out);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
564 - return Ok(out);
564 + Ok(out)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L558
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:558:9
|
558 | / return Ok(FormatRes {
559 | | rendered: format!("{}{}", shebang, out.rendered),
560 | | lost_comments: out.lost_comments,
561 | | warnings: out.warnings,
562 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
558 ~ Ok(FormatRes {
559 + rendered: format!("{}{}", shebang, out.rendered),
560 + lost_comments: out.lost_comments,
561 + warnings: out.warnings,
562 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L478
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:478:29
|
478 | IndentUnit::Tabs => return "\t".repeat(current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
478 - IndentUnit::Tabs => return "\t".repeat(current_indent.0),
478 + IndentUnit::Tabs => "\t".repeat(current_indent.0),
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L477
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:477:31
|
477 | IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
477 - IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
477 + IndentUnit::Spaces => " ".repeat(config.indent_spaces * current_indent.0),
|
|
|
accessing first element with `new_segs.get(0)`:
crates/genemichaels-lib/src/lib.rs#L187
warning: accessing first element with `new_segs.get(0)`
--> crates/genemichaels-lib/src/lib.rs:187:21
|
187 | let seg_i = new_segs.get(0).unwrap();
| ^^^^^^^^^^^^^^^ help: try: `new_segs.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L732
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:732:25
|
732 | return build_self(out, base_indent);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
732 - return build_self(out, base_indent);
732 + build_self(out, base_indent)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L730
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:730:25
|
730 | return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
730 - return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
730 + new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref())
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_type.rs#L379
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_type.rs:379:37
|
379 | sg.seg(out, &c.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `c.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_type.rs#L128
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_type.rs:128:23
|
128 | node.seg(out, &seg.value().ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `seg.value().ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1222
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1222:29
|
1222 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1217
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1217:29
|
1217 | sg.seg(out, &format!("{}::", x.ident));
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}::", x.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1198
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1198:33
|
1198 | sg.seg(out, &format!("{}: ", n));
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1068
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1068:33
|
1068 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L903
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:903:33
|
903 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L884
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:884:33
|
884 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L851
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:851:33
|
851 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L835
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:835:37
|
835 | sg.seg(out, &format!(" {}", n));
| ^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {}", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L765
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:765:37
|
765 | sg.seg(out, &name.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L691
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:691:33
|
691 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L669
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:669:33
|
669 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L184
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:184:49
|
184 | ... sg.seg(out, &format!(" {} ", t.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {} ", t.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L171
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:171:33
|
171 | sg.seg(out, &format!("{} ", l.let_token.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{} ", l.let_token.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
this loop could be written as a `while let` loop:
crates/genemichaels-lib/src/sg_pat.rs#L70
warning: this loop could be written as a `while let` loop
--> crates/genemichaels-lib/src/sg_pat.rs:70:29
|
70 | / ... loop {
71 | | ... let t = match at.1.as_ref() {
72 | | ... Pat::Tuple(t) => t,
73 | | ... _ => break,
... |
116 | | ... return sg0.build(out);
117 | | ... };
| |_______________________^ help: try: `while let Pat::Tuple(t) = at.1.as_ref() { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L653
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:653:17
|
653 | / return Some(Whitespace {
654 | | loc: w.loc,
655 | | mode: WhitespaceMode::Comment(c),
656 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
653 ~ Some(Whitespace {
654 + loc: w.loc,
655 + mode: WhitespaceMode::Comment(c),
656 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L647
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:647:17
|
647 | / return Some(Whitespace {
648 | | loc: w.loc,
649 | | mode: WhitespaceMode::BlankLines(use_lines),
650 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
647 ~ Some(Whitespace {
648 + loc: w.loc,
649 + mode: WhitespaceMode::BlankLines(use_lines),
650 ~ })
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L612
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:612:41
|
612 | ... sg.seg(out, &l.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `l.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L605
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:605:41
|
605 | ... sg.seg(out, &p.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `p.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L593
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:593:62
|
593 | ... TokenTree::Literal(_) => match p.as_char() {
| ________________________________________________^
594 | | ... ':' => false,
595 | | ... '.' => false,
596 | | ... _ => true,
597 | | ... },
| |_______________________^ help: try: `!matches!(p.as_char(), ':' | '.')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L586
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:586:41
|
586 | ... sg.seg(out, &i.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `i.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/sg_general.rs#L534
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/sg_general.rs:534:76
|
534 | ... TokenTree::Punct(punct) => !is_pull_next_punct(&punct),
| ^^^^^^ help: change this to: `punct`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L530
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:530:21
|
530 | / return match &prev {
531 | | Some(prev) => match prev {
532 | | TokenTree::Group(_) => true,
533 | | TokenTree::Ident(_) | TokenTree::Literal(_) => true,
... |
536 | | None => false,
537 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
530 ~ match &prev {
531 + Some(prev) => match prev {
532 + TokenTree::Group(_) => true,
533 + TokenTree::Ident(_) | TokenTree::Literal(_) => true,
534 + TokenTree::Punct(punct) => !is_pull_next_punct(&punct),
535 + },
536 + None => false,
537 ~ }
|
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:518:28
|
518 | return match p.as_char() {
| ____________________________^
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^ help: try: `matches!(p.as_char(), '.' | '\'' | '$' | '#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:518:21
|
518 | / return match p.as_char() {
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
518 ~ match p.as_char() {
519 + '.' => true,
520 + '\'' => true,
521 + '$' => true,
522 + '#' => true,
523 + _ => false,
524 ~ }
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L885
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:885:33
|
885 | sg.seg(out, &e.op.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `e.op.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L456
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:456:45
|
456 | ... sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L306
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:306:37
|
306 | sg.seg(out, &format!(" '{}", l.ident))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" '{}", l.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L280
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:280:37
|
280 | sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= 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
|
|
accessing first element with `children.get(0)`:
crates/genemichaels-lib/src/sg_expr.rs#L176
warning: accessing first element with `children.get(0)`
--> crates/genemichaels-lib/src/sg_expr.rs:176:48
|
176 | sg.child(build_child(out, base_indent, children.get(0).unwrap()));
| ^^^^^^^^^^^^^^^ help: try: `children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L1011
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:1011:29
|
1011 | unicode_len(&prefix),
| ^^^^^^^ help: change this to: `prefix`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L947
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:947:43
|
947 | Node::InlineCode(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L942
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:942:37
|
942 | Node::Text(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
accessing first element with `x.children.get(0)`:
crates/genemichaels-lib/src/whitespace.rs#L940
warning: accessing first element with `x.children.get(0)`
--> crates/genemichaels-lib/src/whitespace.rs:940:17
|
940 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
this expression borrows a value the compiler would automatically borrow:
crates/genemichaels-lib/src/whitespace.rs#L642
warning: this expression borrows a value the compiler would automatically borrow
--> crates/genemichaels-lib/src/whitespace.rs:642:17
|
642 | (&text[found.writable..]).to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `text[found.writable..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L595
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:595:40
|
595 | state.line_buffer.push_str(&text);
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L580
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:580:50
|
580 | writable: if width + unicode_len(&text) > max_len {
| ^^^^^ help: change this to: `text`
|
= 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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L579
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:579:13
|
579 | / return FoundWritableLen {
580 | | writable: if width + unicode_len(&text) > max_len {
581 | | writable
582 | | } else {
... |
586 | | next_break: None,
587 | | };
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
579 ~ FoundWritableLen {
580 + writable: if width + unicode_len(&text) > max_len {
581 + writable
582 + } else {
583 + text.len()
584 + },
585 + previous_break: previous_break,
586 + next_break: None,
587 ~ }
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L660
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:660:13
|
660 | return;
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
659 - state.line_buffer.push_str(text);
660 - return;
659 + state.line_buffer.push_str(text);
|
|
|
called `skip(..).next()` on an iterator:
crates/genemichaels-lib/src/whitespace.rs#L406
warning: called `skip(..).next()` on an iterator
--> crates/genemichaels-lib/src/whitespace.rs:406:48
|
406 | source = source.lines().skip(e.span().start().line - 1).next().unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(e.span().start().line - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
= note: `#[warn(clippy::iter_skip_next)]` on by default
|
|
calling `push_str()` using a single-character string literal:
crates/genemichaels-lib/src/whitespace.rs#L284
warning: calling `push_str()` using a single-character string literal
--> crates/genemichaels-lib/src/whitespace.rs:284:25
|
284 | previous_comment.lines.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `previous_comment.lines.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
|
use of `or_insert` to construct default value:
crates/genemichaels-lib/src/whitespace.rs#L265
warning: use of `or_insert` to construct default value
--> crates/genemichaels-lib/src/whitespace.rs:265:79
|
265 | let whitespaces = self.whitespaces.entry(HashLineColumn(end)).or_insert(vec![]);
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
|
useless conversion to the same type: `&str`:
crates/genemichaels-lib/src/whitespace.rs#L208
warning: useless conversion to the same type: `&str`
--> crates/genemichaels-lib/src/whitespace.rs:208:65
|
208 | ... buffer.add(CommentMode::Normal, "".into());
| ^^^^^^^^^ help: consider removing `.into()`: `""`
|
= 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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L42
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:42:9
|
42 | return Some(self.0.cmp(&other.0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
42 - return Some(self.0.cmp(&other.0));
42 + Some(self.0.cmp(&other.0))
|
|
|
non-canonical implementation of `partial_cmp` on an `Ord` type:
crates/genemichaels-lib/src/whitespace.rs#L40
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> crates/genemichaels-lib/src/whitespace.rs:40:1
|
40 | / impl PartialOrd for HashLineColumn {
41 | | fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
| | _______________________________________________________________________-
42 | || return Some(self.0.cmp(&other.0));
43 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
44 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
= note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L36
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:36:9
|
36 | return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
36 - return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
36 + self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column))
|
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L888
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:888:9
|
888 | warnings: warnings,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `warnings`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L886
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:886:9
|
886 | rendered: rendered,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `rendered`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L585
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:585:17
|
585 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L573
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:573:25
|
573 | next_break: next_break,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L572
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:572:25
|
572 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L571
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:571:25
|
571 | writable: writable,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `writable`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L495
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:495:13
|
495 | base_prefix_len: base_prefix_len,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `base_prefix_len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L337
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:337:9
|
337 | line_lookup: line_lookup,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `line_lookup`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L336
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:336:9
|
336 | keep_max_blank_lines: keep_max_blank_lines,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `keep_max_blank_lines`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L335
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:335:9
|
335 | source: source,
| ^^^^^^^^^^^^^^ help: replace it with: `source`
|
= 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
|
|
using `clone` on type `FormatConfig` which implements the `Copy` trait:
crates/genemichaels-lib/src/lib.rs#L578
warning: using `clone` on type `FormatConfig` which implements the `Copy` trait
--> crates/genemichaels-lib/src/lib.rs:578:17
|
578 | config: config.clone(),
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*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
|
|
lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`:
crates/genemichaels-lib/src/lib.rs#L5
warning: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
--> crates/genemichaels-lib/src/lib.rs:5:5
|
5 | clippy::derive_hash_xor_eq
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L564
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:564:9
|
564 | return Ok(out);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
564 - return Ok(out);
564 + Ok(out)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L558
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:558:9
|
558 | / return Ok(FormatRes {
559 | | rendered: format!("{}{}", shebang, out.rendered),
560 | | lost_comments: out.lost_comments,
561 | | warnings: out.warnings,
562 | | });
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
558 ~ Ok(FormatRes {
559 + rendered: format!("{}{}", shebang, out.rendered),
560 + lost_comments: out.lost_comments,
561 + warnings: out.warnings,
562 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L478
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:478:29
|
478 | IndentUnit::Tabs => return "\t".repeat(current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
478 - IndentUnit::Tabs => return "\t".repeat(current_indent.0),
478 + IndentUnit::Tabs => "\t".repeat(current_indent.0),
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/lib.rs#L477
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/lib.rs:477:31
|
477 | IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
477 - IndentUnit::Spaces => return " ".repeat(config.indent_spaces * current_indent.0),
477 + IndentUnit::Spaces => " ".repeat(config.indent_spaces * current_indent.0),
|
|
|
accessing first element with `new_segs.get(0)`:
crates/genemichaels-lib/src/lib.rs#L187
warning: accessing first element with `new_segs.get(0)`
--> crates/genemichaels-lib/src/lib.rs:187:21
|
187 | let seg_i = new_segs.get(0).unwrap();
| ^^^^^^^^^^^^^^^ help: try: `new_segs.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L732
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:732:25
|
732 | return build_self(out, base_indent);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
732 - return build_self(out, base_indent);
732 + build_self(out, base_indent)
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_type.rs#L730
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_type.rs:730:25
|
730 | return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
730 - return new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref());
730 + new_sg_binary(out, base_indent, build_self, colon.span.start(), ":", x.ty.as_ref())
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_type.rs#L379
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_type.rs:379:37
|
379 | sg.seg(out, &c.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `c.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1222
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1222:29
|
1222 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1217
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1217:29
|
1217 | sg.seg(out, &format!("{}::", x.ident));
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}::", x.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1198
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1198:33
|
1198 | sg.seg(out, &format!("{}: ", n));
| ^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L1068
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:1068:33
|
1068 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L903
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:903:33
|
903 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L884
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:884:33
|
884 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L851
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:851:33
|
851 | sg.seg(out, &x.ident.to_string());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `x.ident.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L835
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:835:37
|
835 | sg.seg(out, &format!(" {}", n));
| ^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {}", n)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L765
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:765:37
|
765 | sg.seg(out, &name.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L192
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:192:33
|
192 | sg.seg(out, &l.semi_token.to_token_stream());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `l.semi_token.to_token_stream()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L184
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:184:49
|
184 | ... sg.seg(out, &format!(" {} ", t.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" {} ", t.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_statement.rs#L171
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_statement.rs:171:33
|
171 | sg.seg(out, &format!("{} ", l.let_token.to_token_stream()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{} ", l.let_token.to_token_stream())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
this loop could be written as a `while let` loop:
crates/genemichaels-lib/src/sg_pat.rs#L70
warning: this loop could be written as a `while let` loop
--> crates/genemichaels-lib/src/sg_pat.rs:70:29
|
70 | / ... loop {
71 | | ... let t = match at.1.as_ref() {
72 | | ... Pat::Tuple(t) => t,
73 | | ... _ => break,
... |
116 | | ... return sg0.build(out);
117 | | ... };
| |_______________________^ help: try: `while let Pat::Tuple(t) = at.1.as_ref() { .. }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
= note: `#[warn(clippy::while_let_loop)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L653
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:653:17
|
653 | / return Some(Whitespace {
654 | | loc: w.loc,
655 | | mode: WhitespaceMode::Comment(c),
656 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
653 ~ Some(Whitespace {
654 + loc: w.loc,
655 + mode: WhitespaceMode::Comment(c),
656 ~ })
|
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L647
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:647:17
|
647 | / return Some(Whitespace {
648 | | loc: w.loc,
649 | | mode: WhitespaceMode::BlankLines(use_lines),
650 | | });
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
647 ~ Some(Whitespace {
648 + loc: w.loc,
649 + mode: WhitespaceMode::BlankLines(use_lines),
650 ~ })
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L612
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:612:41
|
612 | ... sg.seg(out, &l.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `l.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L605
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:605:41
|
605 | ... sg.seg(out, &p.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `p.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L593
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:593:62
|
593 | ... TokenTree::Literal(_) => match p.as_char() {
| ________________________________________________^
594 | | ... ':' => false,
595 | | ... '.' => false,
596 | | ... _ => true,
597 | | ... },
| |_______________________^ help: try: `!matches!(p.as_char(), ':' | '.')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_general.rs#L586
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_general.rs:586:41
|
586 | ... sg.seg(out, &i.to_string());
| ^^^^^^^^^^^^^^ help: change this to: `i.to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L530
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:530:21
|
530 | / return match &prev {
531 | | Some(prev) => match prev {
532 | | TokenTree::Group(_) => true,
533 | | TokenTree::Ident(_) | TokenTree::Literal(_) => true,
... |
536 | | None => false,
537 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
530 ~ match &prev {
531 + Some(prev) => match prev {
532 + TokenTree::Group(_) => true,
533 + TokenTree::Ident(_) | TokenTree::Literal(_) => true,
534 + TokenTree::Punct(punct) => !is_pull_next_punct(&punct),
535 + },
536 + None => false,
537 ~ }
|
|
|
match expression looks like `matches!` macro:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: match expression looks like `matches!` macro
--> crates/genemichaels-lib/src/sg_general.rs:518:28
|
518 | return match p.as_char() {
| ____________________________^
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^ help: try: `matches!(p.as_char(), '.' | '\'' | '$' | '#')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/sg_general.rs#L518
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/sg_general.rs:518:21
|
518 | / return match p.as_char() {
519 | | '.' => true,
520 | | '\'' => true,
521 | | '$' => true,
522 | | '#' => true,
523 | | _ => false,
524 | | };
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
518 ~ match p.as_char() {
519 + '.' => true,
520 + '\'' => true,
521 + '$' => true,
522 + '#' => true,
523 + _ => false,
524 ~ }
|
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L885
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:885:33
|
885 | sg.seg(out, &e.op.to_token_stream().to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `e.op.to_token_stream().to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L456
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:456:45
|
456 | ... sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L306
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:306:37
|
306 | sg.seg(out, &format!(" '{}", l.ident))
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!(" '{}", l.ident)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
|
the borrowed expression implements the required traits:
crates/genemichaels-lib/src/sg_expr.rs#L280
warning: the borrowed expression implements the required traits
--> crates/genemichaels-lib/src/sg_expr.rs:280:37
|
280 | sg.seg(out, &format!("{}: ", l.name));
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}: ", l.name)`
|
= 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
|
|
accessing first element with `children.get(0)`:
crates/genemichaels-lib/src/sg_expr.rs#L176
warning: accessing first element with `children.get(0)`
--> crates/genemichaels-lib/src/sg_expr.rs:176:48
|
176 | sg.child(build_child(out, base_indent, children.get(0).unwrap()));
| ^^^^^^^^^^^^^^^ help: try: `children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L1011
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:1011:29
|
1011 | unicode_len(&prefix),
| ^^^^^^^ help: change this to: `prefix`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L947
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:947:43
|
947 | Node::InlineCode(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L942
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:942:37
|
942 | Node::Text(t) => if get_splits(&t.value).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t.value).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
accessing first element with `x.children.get(0)`:
crates/genemichaels-lib/src/whitespace.rs#L940
warning: accessing first element with `x.children.get(0)`
--> crates/genemichaels-lib/src/whitespace.rs:940:17
|
940 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L895
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:895:24
|
895 | if get_splits(&t).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L887
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:887:24
|
887 | if get_splits(&t).first().is_some() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&t).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
|
|
accessing first element with `x.children.get(0)`:
crates/genemichaels-lib/src/whitespace.rs#L883
warning: accessing first element with `x.children.get(0)`
--> crates/genemichaels-lib/src/whitespace.rs:883:17
|
883 | x.children.get(0)
| ^^^^^^^^^^^^^^^^^ help: try: `x.children.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
|
|
unnecessary use of `first().is_some()` to check if slice is not empty:
crates/genemichaels-lib/src/whitespace.rs#L851
warning: unnecessary use of `first().is_some()` to check if slice is not empty
--> crates/genemichaels-lib/src/whitespace.rs:851:20
|
851 | match (get_splits(&join_lines(&alt)).first().is_some(), &x.title) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace this with: `!get_splits(&join_lines(&alt)).is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check
= note: `#[warn(clippy::unnecessary_first_then_check)]` on by default
|
|
this expression borrows a value the compiler would automatically borrow:
crates/genemichaels-lib/src/whitespace.rs#L657
warning: this expression borrows a value the compiler would automatically borrow
--> crates/genemichaels-lib/src/whitespace.rs:657:70
|
657 | write_forward_breaks(state, &mut s, out, max_len, false, (&text[b..]).to_string(), b, breaks);
| ^^^^^^^^^^^^ help: change this to: `text[b..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression borrows a value the compiler would automatically borrow:
crates/genemichaels-lib/src/whitespace.rs#L642
warning: this expression borrows a value the compiler would automatically borrow
--> crates/genemichaels-lib/src/whitespace.rs:642:17
|
642 | (&text[found.writable..]).to_string(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `text[found.writable..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L595
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:595:40
|
595 | state.line_buffer.push_str(&text);
| ^^^^^ help: change this to: `text`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
crates/genemichaels-lib/src/whitespace.rs#L580
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/genemichaels-lib/src/whitespace.rs:580:50
|
580 | writable: if width + unicode_len(&text) > max_len {
| ^^^^^ help: change this to: `text`
|
= 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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L579
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:579:13
|
579 | / return FoundWritableLen {
580 | | writable: if width + unicode_len(&text) > max_len {
581 | | writable
582 | | } else {
... |
586 | | next_break: None,
587 | | };
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
579 ~ FoundWritableLen {
580 + writable: if width + unicode_len(&text) > max_len {
581 + writable
582 + } else {
583 + text.len()
584 + },
585 + previous_break: previous_break,
586 + next_break: None,
587 ~ }
|
|
|
called `skip(..).next()` on an iterator:
crates/genemichaels-lib/src/whitespace.rs#L406
warning: called `skip(..).next()` on an iterator
--> crates/genemichaels-lib/src/whitespace.rs:406:48
|
406 | source = source.lines().skip(e.span().start().line - 1).next().unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(e.span().start().line - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
= note: `#[warn(clippy::iter_skip_next)]` on by default
|
|
calling `push_str()` using a single-character string literal:
crates/genemichaels-lib/src/whitespace.rs#L284
warning: calling `push_str()` using a single-character string literal
--> crates/genemichaels-lib/src/whitespace.rs:284:25
|
284 | previous_comment.lines.push_str("\n");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `previous_comment.lines.push('\n')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
|
use of `or_insert` to construct default value:
crates/genemichaels-lib/src/whitespace.rs#L265
warning: use of `or_insert` to construct default value
--> crates/genemichaels-lib/src/whitespace.rs:265:79
|
265 | let whitespaces = self.whitespaces.entry(HashLineColumn(end)).or_insert(vec![]);
| ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
|
useless conversion to the same type: `&str`:
crates/genemichaels-lib/src/whitespace.rs#L208
warning: useless conversion to the same type: `&str`
--> crates/genemichaels-lib/src/whitespace.rs:208:65
|
208 | ... buffer.add(CommentMode::Normal, "".into());
| ^^^^^^^^^ help: consider removing `.into()`: `""`
|
= 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
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L42
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:42:9
|
42 | return Some(self.0.cmp(&other.0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
42 - return Some(self.0.cmp(&other.0));
42 + Some(self.0.cmp(&other.0))
|
|
|
non-canonical implementation of `partial_cmp` on an `Ord` type:
crates/genemichaels-lib/src/whitespace.rs#L40
warning: non-canonical implementation of `partial_cmp` on an `Ord` type
--> crates/genemichaels-lib/src/whitespace.rs:40:1
|
40 | / impl PartialOrd for HashLineColumn {
41 | | fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
| | _______________________________________________________________________-
42 | || return Some(self.0.cmp(&other.0));
43 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
44 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl
= note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default
|
|
unneeded `return` statement:
crates/genemichaels-lib/src/whitespace.rs#L36
warning: unneeded `return` statement
--> crates/genemichaels-lib/src/whitespace.rs:36:9
|
36 | return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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`
|
36 - return self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column));
36 + self.0.line.cmp(&other.0.line).then(self.0.column.cmp(&other.0.column))
|
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L888
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:888:9
|
888 | warnings: warnings,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `warnings`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/lib.rs#L886
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/lib.rs:886:9
|
886 | rendered: rendered,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `rendered`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L585
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:585:17
|
585 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L573
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:573:25
|
573 | next_break: next_break,
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L572
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:572:25
|
572 | previous_break: previous_break,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `previous_break`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L571
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:571:25
|
571 | writable: writable,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `writable`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L495
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:495:13
|
495 | base_prefix_len: base_prefix_len,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `base_prefix_len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L337
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:337:9
|
337 | line_lookup: line_lookup,
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `line_lookup`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L336
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:336:9
|
336 | keep_max_blank_lines: keep_max_blank_lines,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `keep_max_blank_lines`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
|
redundant field names in struct initialization:
crates/genemichaels-lib/src/whitespace.rs#L335
warning: redundant field names in struct initialization
--> crates/genemichaels-lib/src/whitespace.rs:335:9
|
335 | source: source,
| ^^^^^^^^^^^^^^ help: replace it with: `source`
|
= 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
|
|
lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`:
crates/genemichaels-lib/src/lib.rs#L5
warning: lint `clippy::derive_hash_xor_eq` has been renamed to `clippy::derived_hash_with_manual_eq`
--> crates/genemichaels-lib/src/lib.rs:5:5
|
5 | clippy::derive_hash_xor_eq
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::derived_hash_with_manual_eq`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
|