Skip to content

Update embassy-sync and embassy-time (#185) #197

Update embassy-sync and embassy-time (#185)

Update embassy-sync and embassy-time (#185) #197

GitHub Actions / clippy succeeded Dec 4, 2023 in 1s

clippy

56 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 56
Note 0
Help 0

Versions

  • rustc 1.76.0-nightly (9fad68599 2023-12-03)
  • cargo 1.76.0-nightly (623b78849 2023-12-02)
  • clippy 0.1.76 (9fad685 2023-12-03)

Annotations

Check warning on line 6 in examples/src/common/general/mod.rs

See this annotation in the file changed.

@github-actions 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 124 in atat/src/asynch/client.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary boolean `not` operation

warning: unnecessary boolean `not` operation
   --> atat/src/asynch/client.rs:116:9
    |
116 | /         if !Cmd::EXPECTS_RESPONSE_CODE {
117 | |             self.send_command(cmd_slice).await?;
118 | |             cmd.parse(Ok(&[]))
119 | |         } else {
...   |
123 | |             cmd.parse((&response).into())
124 | |         }
    | |_________^
    |
    = 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 104 in atat/src/asynch/client.rs

See this annotation in the file changed.

@github-actions 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:104:13
    |
104 |             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 86 in atat/src/asynch/client.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
  --> atat/src/asynch/client.rs:86:32
   |
86 |                 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 31 in atat/src/asynch/client.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be a `const fn`

warning: this could be a `const fn`
  --> atat/src/asynch/client.rs:20:5
   |
20 | /     pub(crate) fn new(
21 | |         writer: W,
22 | |         res_channel: &'a ResponseChannel<INGRESS_BUF_SIZE>,
23 | |         config: Config,
...  |
30 | |         }
31 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

Check warning on line 125 in atat/src/blocking/client.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary boolean `not` operation

warning: unnecessary boolean `not` operation
   --> atat/src/blocking/client.rs:118:9
    |
118 | /         if !Cmd::EXPECTS_RESPONSE_CODE {
119 | |             self.send_command(cmd_slice)?;
120 | |             cmd.parse(Ok(&[]))
121 | |         } else {
...   |
124 | |             cmd.parse((&response).into())
125 | |         }
    | |_________^
    |
    = 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 39 in atat/src/blocking/client.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be a `const fn`

warning: this could be a `const fn`
  --> atat/src/blocking/client.rs:28:5
   |
28 | /     pub(crate) fn new(
29 | |         writer: W,
30 | |         res_channel: &'a ResponseChannel<INGRESS_BUF_SIZE>,
31 | |         config: Config,
...  |
38 | |         }
39 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn

Check warning on line 33 in atat/src/urc_channel.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

warning: docs for function which may panic missing `# Panics` section
  --> atat/src/urc_channel.rs:33:5
   |
33 |     pub fn publisher(&self) -> UrcPublisher<Urc, CAPACITY, SUBSCRIBERS> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> atat/src/urc_channel.rs:34:9
   |
34 |         self.0.publisher().unwrap()
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

Check warning on line 29 in atat/src/urc_channel.rs

See this annotation in the file changed.

@github-actions 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:29:5
   |
29 |     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 108 in atat/src/traits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
   --> atat/src/traits.rs:108:48
    |
108 |         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 75 in atat/src/response.rs

See this annotation in the file changed.

@github-actions 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()`
   |
   = note: converting `u8` to `ConnectionError` cannot fail
   = 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

See this annotation in the file changed.

@github-actions 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()`
   |
   = note: converting `u16` to `CmsError` cannot fail
   = 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

See this annotation in the file changed.

@github-actions 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()`
   |
   = note: converting `u16` to `CmeError` cannot fail
   = 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 265 in atat/src/ingress.rs

See this annotation in the file changed.

@github-actions 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:265:33
    |
265 | ...                   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 180 in atat/src/ingress.rs

See this annotation in the file changed.

@github-actions 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:180:33
    |
180 | ...                   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
    = note: `-W clippy::semicolon-if-nothing-returned` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::semicolon_if_nothing_returned)]`

Check warning on line 117 in atat/src/ingress.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be a `const fn`

warning: this could be a `const fn`
   --> atat/src/ingress.rs:105:5
    |
105 | /     pub fn new(
106 | |         digester: D,
107 | |         res_publisher: ResponsePublisher<'a, INGRESS_BUF_SIZE>,
108 | |         urc_publisher: UrcPublisher<'a, Urc, URC_CAPACITY, URC_SUBSCRIBERS>,
...   |
116 | |         }
117 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
    = note: `-W clippy::missing-const-for-fn` implied by `-W clippy::nursery`
    = help: to override `-W clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]`

Check warning on line 6 in atat/src/ingress.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are deriving `PartialEq` and can implement `Eq`

warning: you are deriving `PartialEq` and can implement `Eq`
 --> atat/src/ingress.rs:6:17
  |
6 | #[derive(Debug, 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
  = note: `-W clippy::derive-partial-eq-without-eq` implied by `-W clippy::nursery`
  = help: to override `-W clippy::nursery` add `#[allow(clippy::derive_partial_eq_without_eq)]`

Check warning on line 88 in atat/src/error/cms_error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
  --> atat/src/error/cms_error.rs:88:5
   |
88 |     pub const fn from_msg(s: &[u8]) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn from_msg(s: &[u8]) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 506 in atat/src/error/cme_error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

warning: this method could have a `#[must_use]` attribute
   --> atat/src/error/cme_error.rs:506:5
    |
506 |     pub const fn from_msg(s: &[u8]) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub const fn from_msg(s: &[u8]) -> Self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 480 in atat/src/digest.rs

See this annotation in the file changed.

@github-actions 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/src/digest.rs:477:9
    |
477 | /         match x.iter().position(|&x| x != b' ') {
478 | |             Some(offset) => &x[offset..],
479 | |             None => &x[0..0],
480 | |         }
    | |_________^ help: try: `x.iter().position(|&x| x != b' ').map_or_else(|| &x[0..0], |offset| &x[offset..])`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
    = note: `-W clippy::option-if-let-else` implied by `-W clippy::nursery`
    = help: to override `-W clippy::nursery` add `#[allow(clippy::option_if_let_else)]`

Check warning on line 476 in atat/src/digest.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

warning: this function could have a `#[must_use]` attribute
   --> atat/src/digest.rs:476:5
    |
476 |     pub fn trim_start_ascii_space(x: &[u8]) -> &[u8] {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn trim_start_ascii_space(x: &[u8]) -> &[u8]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check warning on line 471 in atat/src/digest.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this could be rewritten as `let...else`

warning: this could be rewritten as `let...else`
   --> atat/src/digest.rs:468:9
    |
468 | /         let from = match x.iter().position(|x| !x.is_ascii_whitespace()) {
469 | |             Some(i) => i,
470 | |             None => return &x[0..0],
471 | |         };
    | |__________^ help: consider writing: `let Some(from) = x.iter().position(|x| !x.is_ascii_whitespace()) else { return &x[0..0] };`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
    = note: `-W clippy::manual-let-else` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::manual_let_else)]`