Fix: Ignoring reported when calling get shadow #232
clippy
48 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 48 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.72.0-nightly (5ea666864 2023-06-27)
- cargo 1.72.0-nightly (03bc66b55 2023-06-23)
- clippy 0.1.72 (5ea6668 2023-06-27)
Annotations
Check warning on line 568 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:568:13
|
568 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 510 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:510:21
|
510 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 493 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:493:33
|
493 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 490 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:490:32
|
490 | if let Some(_) = delta.state {
| -------^^^^^^^-------------- help: try this: `if delta.state.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 484 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:484:21
|
484 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 461 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:461:29
|
461 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 445 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:445:39
|
445 | } else if let Some(_) = response.state.reported {
| -------^^^^^^^-------------------------- help: try this: `if response.state.reported.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 438 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:438:33
|
438 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 435 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:435:32
|
435 | if let Some(_) = response.state.delta {
| -------^^^^^^^----------------------- help: try this: `if response.state.delta.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 417 in src/shadows/mod.rs
github-actions / clippy
this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
warning: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
--> src/shadows/mod.rs:413:5
|
413 | / pub fn handle_message(
414 | | &mut self,
415 | | topic: &str,
416 | | payload: &[u8],
417 | | ) -> Result<(&S, Option<S::PatchState>), Error> {
| |___________________________________________________^
|
= help: either add some descriptive text or remove the attribute
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
Check warning on line 305 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:305:21
|
305 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 288 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:288:33
|
288 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 285 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:285:32
|
285 | if let Some(_) = delta.state {
| -------^^^^^^^-------------- help: try this: `if delta.state.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 279 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:279:21
|
279 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 256 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:256:29
|
256 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 238 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:238:39
|
238 | } else if let Some(_) = response.state.reported {
| -------^^^^^^^-------------------------- help: try this: `if response.state.reported.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 230 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:230:33
|
230 | ... S::NAME.unwrap_or_else(|| CLASSIC_SHADOW)
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 227 in src/shadows/mod.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/shadows/mod.rs:227:32
|
227 | if let Some(_) = response.state.delta {
| -------^^^^^^^----------------------- help: try this: `if response.state.delta.is_some()`
|
= note: this will change drop order of the result, as well as all temporaries
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
Check warning on line 207 in src/shadows/mod.rs
github-actions / clippy
this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
warning: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
--> src/shadows/mod.rs:203:5
|
203 | / pub fn handle_message(
204 | | &mut self,
205 | | topic: &str,
206 | | payload: &[u8],
207 | | ) -> Result<(S, Option<S::PatchState>), Error> {
| |__________________________________________________^
|
= help: either add some descriptive text or remove the attribute
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
= note: `#[warn(clippy::double_must_use)]` on by default
Check warning on line 97 in src/shadows/mod.rs
github-actions / clippy
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> src/shadows/mod.rs:97:13
|
97 | S::NAME.unwrap_or_else(|| CLASSIC_SHADOW),
| ^^^^^^^^---------------------------------
| |
| help: use `unwrap_or(..)` instead: `unwrap_or(CLASSIC_SHADOW)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
Check warning on line 295 in src/shadows/topics.rs
github-actions / clippy
useless conversion to the same type: `shadows::topics::Topic`
warning: useless conversion to the same type: `shadows::topics::Topic`
--> src/shadows/topics.rs:295:26
|
295 | .map(|topic| Topic::from(*topic).format(thing_name, shadow_name))
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `Topic::from()`: `(*topic)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 233 in src/shadows/topics.rs
github-actions / clippy
useless conversion to the same type: `shadows::topics::Topic`
warning: useless conversion to the same type: `shadows::topics::Topic`
--> src/shadows/topics.rs:233:37
|
233 | .map(|(topic, qos)| Ok((Topic::from(*topic).format(thing_name, shadow_name)?, *qos)))
| ^^^^^^^^^^^^^^^^^^^ help: consider removing `Topic::from()`: `(*topic)`
|
= 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
Check warning on line 48 in src/shadows/topics.rs
github-actions / clippy
you are using an explicit closure for copying elements
warning: you are using an explicit closure for copying elements
--> src/shadows/topics.rs:48:22
|
48 | (tt.get(5).map(|s| *s), 6)
| ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tt.get(5).copied()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
= note: `#[warn(clippy::map_clone)]` on by default
Check warning on line 44 in src/shadows/topics.rs
github-actions / clippy
accessing first element with `tt.get(0)`
warning: accessing first element with `tt.get(0)`
--> src/shadows/topics.rs:44:16
|
44 | match (tt.get(0), tt.get(1), tt.get(2), tt.get(3)) {
| ^^^^^^^^^ help: try: `tt.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
Check warning on line 83 in src/shadows/topics.rs
github-actions / clippy
method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
--> src/shadows/topics.rs:42:5
|
42 | / pub fn from_str(s: &str) -> Option<(Self, &str, Option<&str>)> {
43 | | let tt = s.splitn(9, '/').collect::<heapless::Vec<&str, 9>>();
44 | | match (tt.get(0), tt.get(1), tt.get(2), tt.get(3)) {
45 | | (Some(&"$aws"), Some(&"things"), Some(thing_name), Some(&Self::SHADOW)) => {
... |
82 | | }
83 | | }
| |_____^
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait