change Ingress to use external provided buffer (#189) #209
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 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 263 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:263:33
|
263 | ... 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 179 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:179:33
|
179 | ... 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 107 in atat/src/ingress.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/ingress.rs:102:5
|
102 | / pub fn new(
103 | | digester: D,
104 | | buf: &'a mut [u8],
105 | | res_slot: &'a ResponseSlot<RES_BUF_SIZE>,
106 | | urc_channel: &'a UrcChannel<Urc, URC_CAPACITY, URC_SUBSCRIBERS>,
107 | | ) -> Self {
| |_____________^
|
note: first possible panic found here
--> atat/src/ingress.rs:113:28
|
113 | urc_publisher: urc_channel.0.publisher().unwrap(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
= note: `-W clippy::missing-panics-doc` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::missing_panics_doc)]`
Check warning on line 6 in atat/src/ingress.rs
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)]`