Update embassy-time to 0.3 #206
clippy
58 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 58 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.75.0 (82e1608df 2023-12-21)
- cargo 1.75.0 (1d8b05cdd 2023-11-20)
- clippy 0.1.75 (82e1608 2023-12-21)
Annotations
Check warning on line 6 in examples/src/common/general/mod.rs
github-actions / clippy
usage of wildcard import
warning: usage of wildcard import
--> examples/src/common/general/mod.rs:6:5
|
6 | use responses::*;
| ^^^^^^^^^^^^ help: try: `responses::{ManufacturerId, ModelId, SoftwareVersion, WifiMac}`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
= note: `-W clippy::wildcard-imports` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::wildcard_imports)]`
Check warning on line 117 in atat/src/blocking/client.rs
github-actions / clippy
unnecessary boolean `not` operation
warning: unnecessary boolean `not` operation
--> atat/src/blocking/client.rs:111:9
|
111 | / if !Cmd::EXPECTS_RESPONSE_CODE {
112 | | cmd.parse(Ok(&[]))
113 | | } else {
114 | | let response = self.wait_response(Duration::from_millis(Cmd::MAX_TIMEOUT_MS.into()))?;
115 | | let response: &Response<INGRESS_BUF_SIZE> = &response.borrow();
116 | | cmd.parse(response.into())
117 | | }
| |_________^
|
= help: remove the `!` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
Check warning on line 109 in atat/src/blocking/client.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> atat/src/blocking/client.rs:109:29
|
109 | let len = cmd.write(&mut self.buf);
| ^^^^^^^^^^^^^ help: change this to: `self.buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 68 in atat/src/blocking/client.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'guard
warning: the following explicit lifetimes could be elided: 'guard
--> atat/src/blocking/client.rs:68:22
|
68 | fn wait_response<'guard>(
| ^^^^^^
69 | &'guard mut self,
| ^^^^^^
70 | timeout: Duration,
71 | ) -> Result<ResponseSlotGuard<'guard, INGRESS_BUF_SIZE>, Error> {
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
68 ~ fn wait_response(
69 ~ &mut self,
70 | timeout: Duration,
71 ~ ) -> Result<ResponseSlotGuard<'_, INGRESS_BUF_SIZE>, Error> {
|
Check warning on line 118 in atat/src/asynch/client.rs
github-actions / clippy
unnecessary boolean `not` operation
warning: unnecessary boolean `not` operation
--> atat/src/asynch/client.rs:110:9
|
110 | / if !Cmd::EXPECTS_RESPONSE_CODE {
111 | | cmd.parse(Ok(&[]))
112 | | } else {
113 | | let response = self
... |
117 | | cmd.parse(response.into())
118 | | }
| |_________^
|
= help: remove the `!` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `-W clippy::if-not-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::if_not_else)]`
Check warning on line 108 in atat/src/asynch/client.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> atat/src/asynch/client.rs:108:29
|
108 | let len = cmd.write(&mut self.buf);
| ^^^^^^^^^^^^^ help: change this to: `self.buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-W clippy::needless-borrow` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_borrow)]`
Check warning on line 101 in atat/src/asynch/client.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/asynch/client.rs:101:13
|
101 | cooldown.await
| ^^^^^^^^^^^^^^ help: add a `;` here: `cooldown.await;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
Check warning on line 83 in atat/src/asynch/client.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> atat/src/asynch/client.rs:83:32
|
83 | Either::Right((_, fut)) => {
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 24 in atat/src/urc_channel.rs
github-actions / clippy
this method could have a `#[must_use]` attribute
warning: this method could have a `#[must_use]` attribute
--> atat/src/urc_channel.rs:24:5
|
24 | pub const fn new() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn new() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Check warning on line 114 in atat/src/traits.rs
github-actions / clippy
matching over `()` is more explicit
warning: matching over `()` is more explicit
--> atat/src/traits.rs:114:48
|
114 | String::try_from(utf8_string).map_err(|_| Error::Parse)
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
Check warning on line 44 in atat/src/response_slot.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> atat/src/response_slot.rs:44:5
|
44 | pub fn try_get<'a>(&'a self) -> Option<ResponseSlotGuard<'a, N>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> atat/src/response_slot.rs:47:18
|
47 | Some(self.0.try_lock().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 44 in atat/src/response_slot.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> atat/src/response_slot.rs:44:20
|
44 | pub fn try_get<'a>(&'a self) -> Option<ResponseSlotGuard<'a, N>> {
| ^^ ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
44 - pub fn try_get<'a>(&'a self) -> Option<ResponseSlotGuard<'a, N>> {
44 + pub fn try_get(&self) -> Option<ResponseSlotGuard<'_, N>> {
|
Check warning on line 55 in atat_derive/src/helpers.rs
github-actions / clippy
`iter` call on a collection with only one item
warning: `iter` call on a collection with only one item
--> atat_derive/src/helpers.rs:55:17
|
55 | bounds: [trait_bound].iter().cloned().collect(),
| ^^^^^^^^^^^^^^^^^^^^ help: try: `std::iter::once(&trait_bound)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_on_single_items
= note: `-W clippy::iter-on-single-items` implied by `-W clippy::nursery`
= help: to override `-W clippy::nursery` add `#[allow(clippy::iter_on_single_items)]`
Check warning on line 36 in atat/src/response_slot.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> atat/src/response_slot.rs:36:5
|
36 | pub async fn get<'a>(&'a self) -> ResponseSlotGuard<'a, N> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> atat/src/response_slot.rs:40:9
|
40 | self.0.try_lock().unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 36 in atat/src/response_slot.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> atat/src/response_slot.rs:36:22
|
36 | pub async fn get<'a>(&'a self) -> ResponseSlotGuard<'a, N> {
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `-W clippy::needless-lifetimes` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::needless_lifetimes)]`
Check warning on line 23 in atat/src/response_slot.rs
github-actions / clippy
this method could have a `#[must_use]` attribute
warning: this method could have a `#[must_use]` attribute
--> atat/src/response_slot.rs:23:5
|
23 | pub const fn new() -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn new() -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Check warning on line 75 in atat/src/response.rs
github-actions / clippy
use of a fallible conversion when an infallible one could be used
warning: use of a fallible conversion when an infallible one could be used
--> atat/src/response.rs:75:57
|
75 | Err(InternalError::ConnectionError((*e).try_into().unwrap()))
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
Check warning on line 73 in atat/src/response.rs
github-actions / clippy
use of a fallible conversion when an infallible one could be used
warning: use of a fallible conversion when an infallible one could be used
--> atat/src/response.rs:73:71
|
73 | Response::CmsError(e) => Err(InternalError::CmsError((*e).try_into().unwrap())),
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
Check warning on line 72 in atat/src/response.rs
github-actions / clippy
use of a fallible conversion when an infallible one could be used
warning: use of a fallible conversion when an infallible one could be used
--> atat/src/response.rs:72:71
|
72 | Response::CmeError(e) => Err(InternalError::CmeError((*e).try_into().unwrap())),
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
= note: `-W clippy::unnecessary-fallible-conversions` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::unnecessary_fallible_conversions)]`
Check warning on line 22 in atat/src/response.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> atat/src/response.rs:22:5
|
22 | pub fn ok(value: &[u8]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> atat/src/response.rs:23:22
|
23 | Response::Ok(Vec::from_slice(value).unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
Check warning on line 22 in atat/src/response.rs
github-actions / clippy
this method could have a `#[must_use]` attribute
warning: this method could have a `#[must_use]` attribute
--> atat/src/response.rs:22:5
|
22 | pub fn ok(value: &[u8]) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn ok(value: &[u8]) -> Self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
Check warning on line 4 in atat/src/response.rs
github-actions / clippy
you are deriving `PartialEq` and can implement `Eq`
warning: you are deriving `PartialEq` and can implement `Eq`
--> atat/src/response.rs:4:24
|
4 | #[derive(Debug, Clone, PartialEq)]
| ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
Check warning on line 262 in atat/src/ingress.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/ingress.rs:262:33
|
262 | ... debug!("Received OK ({}/{})", swallowed, self.pos,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `debug!("Received OK ({}/{})", swallowed, self.pos,);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
Check warning on line 70 in atat_derive/src/cmd.rs
github-actions / clippy
use Option::map_or_else instead of an if let/else
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:63:34
|
63 | let reattempt_on_parse_err = match reattempt_on_parse_err {
| __________________________________^
64 | | Some(reattempt_on_parse_err) => {
65 | | quote! {
66 | | const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
... |
69 | | None => quote! {},
70 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
63 ~ let reattempt_on_parse_err = reattempt_on_parse_err.map_or_else(|| quote! {}, |reattempt_on_parse_err| quote! {
64 + const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
65 ~ });
|
Check warning on line 61 in atat_derive/src/cmd.rs
github-actions / clippy
use Option::map_or_else instead of an if let/else
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:54:20
|
54 | let attempts = match attempts {
| ____________________^
55 | | Some(attempts) => {
56 | | quote! {
57 | | const ATTEMPTS: u8 = #attempts;
... |
60 | | None => quote! {},
61 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
54 ~ let attempts = attempts.map_or_else(|| quote! {}, |attempts| quote! {
55 + const ATTEMPTS: u8 = #attempts;
56 ~ });
|