Bump embassy-sync to 0.6 (#206) #216
audit.yml
on: push
Cancel previous runs
3s
security_audit
17s
Annotations
94 warnings
Cancel previous runs
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: styfle/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Cancel previous runs
The following actions uses node12 which is deprecated and will be forced to run on node16: styfle/[email protected]. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
security_audit
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/audit-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
security_audit
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/audit-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
usage of wildcard import:
examples/src/common/general/mod.rs#L6
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)]`
|
multiple versions for dependency `nb`: 0.1.3, 1.1.0:
examples/src/lib.rs#L1
warning: multiple versions for dependency `nb`: 0.1.3, 1.1.0
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `heapless`: 0.7.17, 0.8.0:
examples/src/lib.rs#L1
warning: multiple versions for dependency `heapless`: 0.7.17, 0.8.0
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `hash32`: 0.2.1, 0.3.1:
examples/src/lib.rs#L1
warning: multiple versions for dependency `hash32`: 0.2.1, 0.3.1
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
|
multiple versions for dependency `embedded-hal`: 0.2.7, 1.0.0:
examples/src/lib.rs#L1
warning: multiple versions for dependency `embedded-hal`: 0.2.7, 1.0.0
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions
= note: `-W clippy::multiple-crate-versions` implied by `-W clippy::cargo`
= help: to override `-W clippy::cargo` add `#[allow(clippy::multiple_crate_versions)]`
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/urc.rs#L53
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/urc.rs:53:26
|
53 | let digest_arm = if let Some(parse_fn) = parse {
| __________________________^
54 | | quote! {
55 | | #parse_fn(&#code[..]),
56 | | }
... |
60 | | }
61 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
53 ~ let digest_arm = parse.map_or_else(|| quote! {
54 + atat::digest::parser::urc_helper(&#code[..]),
55 + }, |parse_fn| quote! {
56 + #parse_fn(&#code[..]),
57 ~ });
|
|
unnecessary boolean `not` operation:
atat/src/blocking/client.rs#L111
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
atat/src/blocking/client.rs#L109
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
|
temporary with significant `Drop` can be early dropped:
atat/src/blocking/client.rs#L114
warning: temporary with significant `Drop` can be early dropped
--> atat/src/blocking/client.rs:114:17
|
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 | | }
| |_________- temporary `response` is currently being dropped at the end of its contained scope
|
= note: this might lead to unnecessary resource contention
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: merge the temporary construction with its single usage
|
114 ~
115 + let response = self.wait_response(Duration::from_millis(Cmd::MAX_TIMEOUT_MS.into()))?.;
|
help: remove separated single usage
|
115 - let response: &Response<INGRESS_BUF_SIZE> = &response.borrow();
115 +
|
|
the following explicit lifetimes could be elided: 'guard:
atat/src/blocking/client.rs#L68
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> {
|
|
unnecessary boolean `not` operation:
atat/src/asynch/simple_client.rs#L144
warning: unnecessary boolean `not` operation
--> atat/src/asynch/simple_client.rs:144:9
|
144 | / if !Cmd::EXPECTS_RESPONSE_CODE {
145 | | cmd.parse(Ok(&[]))
146 | | } else {
147 | | let response = embassy_time::with_timeout(
... |
154 | | cmd.parse((&response).into())
155 | | }
| |_________^
|
= 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
atat/src/asynch/simple_client.rs#L141
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> atat/src/asynch/simple_client.rs:141:29
|
141 | 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
|
future cannot be sent between threads safely:
atat/src/asynch/simple_client.rs#L140
warning: future cannot be sent between threads safely
--> atat/src/asynch/simple_client.rs:140:5
|
140 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:143:32
|
140 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| --- has type `&Cmd` which is not `Send`
...
143 | self.send_request(len).await?;
| ^^^^^ await occurs here, with `cmd` maybe used later
= note: `Cmd` doesn't implement `core::marker::Sync`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:143:32
|
140 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| --------- has type `&mut asynch::simple_client::SimpleClient<'_, RW, D>` which is not `Send`
...
143 | self.send_request(len).await?;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `RW` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:143:32
|
140 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| --------- has type `&mut asynch::simple_client::SimpleClient<'_, RW, D>` which is not `Send`
...
143 | self.send_request(len).await?;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `D` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
note: future is not `Send` as it awaits another future which is not `Send`
--> atat/src/asynch/simple_client.rs:53:19
|
53 | match self.rw.read(&mut self.buf[self.pos..]).await {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl futures::Future<Output = core::result::Result<usize, <RW as embedded_io::ErrorType>::Error>>`, which is not `Send`
= note: `impl futures::Future<Output = core::result::Result<usize, <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/asynch/simple_client.rs#L134
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/asynch/simple_client.rs:134:13
|
134 | 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
|
future cannot be sent between threads safely:
atat/src/asynch/simple_client.rs#L132
warning: future cannot be sent between threads safely
--> atat/src/asynch/simple_client.rs:132:5
|
132 | async fn wait_cooldown_timer(&mut self) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `wait_cooldown_timer` is not `Send`
|
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> atat/src/asynch/simple_client.rs:132:34
|
132 | async fn wait_cooldown_timer(&mut self) {
| ^^^^^^^^^ has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`, because `asynch::simple_client::SimpleClient<'a, RW, D>` is not `Send`
= note: `RW` doesn't implement `core::marker::Send`
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> atat/src/asynch/simple_client.rs:132:34
|
132 | async fn wait_cooldown_timer(&mut self) {
| ^^^^^^^^^ has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`, because `asynch::simple_client::SimpleClient<'a, RW, D>` is not `Send`
= note: `D` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/asynch/simple_client.rs#L88
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/asynch/simple_client.rs:88:37
|
88 | ... 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
|
future cannot be sent between threads safely:
atat/src/asynch/simple_client.rs#L51
warning: future cannot be sent between threads safely
--> atat/src/asynch/simple_client.rs:51:5
|
51 | async fn wait_response<'guard>(&'guard mut self) -> Result<Response<256>, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `wait_response` is not `Send`
|
note: future is not `Send` as it awaits another future which is not `Send`
--> atat/src/asynch/simple_client.rs:53:19
|
53 | match self.rw.read(&mut self.buf[self.pos..]).await {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl futures::Future<Output = core::result::Result<usize, <RW as embedded_io::ErrorType>::Error>>`, which is not `Send`
= note: `impl futures::Future<Output = core::result::Result<usize, <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:53:59
|
51 | async fn wait_response<'guard>(&'guard mut self) -> Result<Response<256>, Error> {
| ---------------- has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`
52 | loop {
53 | match self.rw.read(&mut self.buf[self.pos..]).await {
| ^^^^^ await occurs here, with `&'guard mut self` maybe used later
= note: `RW` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:53:59
|
51 | async fn wait_response<'guard>(&'guard mut self) -> Result<Response<256>, Error> {
| ---------------- has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`
52 | loop {
53 | match self.rw.read(&mut self.buf[self.pos..]).await {
| ^^^^^ await occurs here, with `&'guard mut self` maybe used later
= note: `D` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
future cannot be sent between threads safely:
atat/src/asynch/simple_client.rs#L27
warning: future cannot be sent between threads safely
--> atat/src/asynch/simple_client.rs:27:5
|
27 | async fn send_request(&mut self, len: usize) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send_request` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:34:36
|
27 | async fn send_request(&mut self, len: usize) -> Result<(), Error> {
| --------- has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`
...
34 | self.wait_cooldown_timer().await;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `RW` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/simple_client.rs:34:36
|
27 | async fn send_request(&mut self, len: usize) -> Result<(), Error> {
| --------- has type `&mut asynch::simple_client::SimpleClient<'a, RW, D>` which is not `Send`
...
34 | self.wait_cooldown_timer().await;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `D` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <RW as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
unnecessary boolean `not` operation:
atat/src/asynch/client.rs#L117
warning: unnecessary boolean `not` operation
--> atat/src/asynch/client.rs:117:9
|
117 | / if !Cmd::EXPECTS_RESPONSE_CODE {
118 | | cmd.parse(Ok(&[]))
119 | | } else {
120 | | let response = self
... |
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)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
atat/src/asynch/client.rs#L115
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> atat/src/asynch/client.rs:115:29
|
115 | 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)]`
|
temporary with significant `Drop` can be early dropped:
atat/src/asynch/client.rs#L120
warning: temporary with significant `Drop` can be early dropped
--> atat/src/asynch/client.rs:120:17
|
119 | } else {
| ________________-
120 | | let response = self
| | ^^^^^^^^
121 | | .wait_response(Duration::from_millis(Cmd::MAX_TIMEOUT_MS.into()))
122 | | .await?;
123 | | let response: &Response<INGRESS_BUF_SIZE> = &response.borrow();
124 | | cmd.parse(response.into())
125 | | }
| |_________- temporary `response` is currently being dropped at the end of its contained scope
|
= note: this might lead to unnecessary resource contention
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: merge the temporary construction with its single usage
|
120 ~
121 + let response = self
122 + .wait_response(Duration::from_millis(Cmd::MAX_TIMEOUT_MS.into()))
123 + .await?.;
|
help: remove separated single usage
|
123 - let response: &Response<INGRESS_BUF_SIZE> = &response.borrow();
123 +
|
|
future cannot be sent between threads safely:
atat/src/asynch/client.rs#L114
warning: future cannot be sent between threads safely
--> atat/src/asynch/client.rs:114:5
|
114 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:116:32
|
114 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| --- has type `&Cmd` which is not `Send`
115 | let len = cmd.write(&mut self.buf);
116 | self.send_request(len).await?;
| ^^^^^ await occurs here, with `cmd` maybe used later
= note: `Cmd` doesn't implement `core::marker::Sync`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:116:32
|
114 | async fn send<Cmd: AtatCmd>(&mut self, cmd: &Cmd) -> Result<Cmd::Response, Error> {
| --------- has type `&mut asynch::client::Client<'_, W, INGRESS_BUF_SIZE>` which is not `Send`
115 | let len = cmd.write(&mut self.buf);
116 | self.send_request(len).await?;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `W` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <W as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <W as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:88:57
|
78 | &self,
| ----- has type `&asynch::client::Client<'_, W, INGRESS_BUF_SIZE>` which is not `Send`
...
88 | fut = match select(fut, Timer::at(expires)).await {
| ^^^^^ await occurs here, with `&self` maybe used later
= note: `W` doesn't implement `core::marker::Sync`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/asynch/client.rs#L108
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/asynch/client.rs:108:13
|
108 | 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
|
future cannot be sent between threads safely:
atat/src/asynch/client.rs#L106
warning: future cannot be sent between threads safely
--> atat/src/asynch/client.rs:106:5
|
106 | async fn wait_cooldown_timer(&mut self) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `wait_cooldown_timer` is not `Send`
|
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> atat/src/asynch/client.rs:106:34
|
106 | async fn wait_cooldown_timer(&mut self) {
| ^^^^^^^^^ has type `&mut asynch::client::Client<'a, W, INGRESS_BUF_SIZE>` which is not `Send`, because `asynch::client::Client<'a, W, INGRESS_BUF_SIZE>` is not `Send`
= note: `W` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
matching over `()` is more explicit:
atat/src/asynch/client.rs#L90
warning: matching over `()` is more explicit
--> atat/src/asynch/client.rs:90:32
|
90 | 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
|
future cannot be sent between threads safely:
atat/src/asynch/client.rs#L77
warning: future cannot be sent between threads safely
--> atat/src/asynch/client.rs:77:5
|
77 | / async fn with_timeout<F: Future>(
78 | | &self,
79 | | timeout: Duration,
80 | | fut: F,
81 | | ) -> Result<F::Output, TimeoutError> {
| |________________________________________^ future returned by `with_timeout` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:88:57
|
85 | pin_mut!(fut);
| ------------- has type `F` which is not `Send`
...
88 | fut = match select(fut, Timer::at(expires)).await {
| ^^^^^ await occurs here, with `mut $x` maybe used later
= note: `F` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:88:57
|
78 | &self,
| ----- has type `&asynch::client::Client<'_, W, INGRESS_BUF_SIZE>` which is not `Send`
...
88 | fut = match select(fut, Timer::at(expires)).await {
| ^^^^^ await occurs here, with `&self` maybe used later
= note: `W` doesn't implement `core::marker::Sync`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
future cannot be sent between threads safely:
atat/src/asynch/client.rs#L68
warning: future cannot be sent between threads safely
--> atat/src/asynch/client.rs:68:5
|
68 | / async fn wait_response<'guard>(
69 | | &'guard mut self,
70 | | timeout: Duration,
71 | | ) -> Result<ResponseSlotGuard<'guard, INGRESS_BUF_SIZE>, Error> {
| |___________________________________________________________________^ future returned by `wait_response` is not `Send`
|
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> atat/src/asynch/client.rs:69:9
|
69 | &'guard mut self,
| ^^^^^^^^^^^^^^^^ has type `&mut asynch::client::Client<'a, W, INGRESS_BUF_SIZE>` which is not `Send`, because `asynch::client::Client<'a, W, INGRESS_BUF_SIZE>` is not `Send`
= note: `W` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:88:57
|
78 | &self,
| ----- has type `&asynch::client::Client<'_, W, INGRESS_BUF_SIZE>` which is not `Send`
...
88 | fut = match select(fut, Timer::at(expires)).await {
| ^^^^^ await occurs here, with `&self` maybe used later
= note: `W` doesn't implement `core::marker::Sync`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
future cannot be sent between threads safely:
atat/src/asynch/client.rs#L38
warning: future cannot be sent between threads safely
--> atat/src/asynch/client.rs:38:5
|
38 | async fn send_request(&mut self, len: usize) -> Result<(), Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `send_request` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/asynch/client.rs:45:36
|
38 | async fn send_request(&mut self, len: usize) -> Result<(), Error> {
| --------- has type `&mut asynch::client::Client<'a, W, INGRESS_BUF_SIZE>` which is not `Send`
...
45 | self.wait_cooldown_timer().await;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `W` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <W as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= note: `impl futures::Future<Output = core::result::Result<(), <W as embedded_io::ErrorType>::Error>>` doesn't implement `core::marker::Send`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
|
this method could have a `#[must_use]` attribute:
atat/src/urc_channel.rs#L24
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
|
you should consider adding a `Default` implementation for `UrcChannel<Urc, CAPACITY, SUBSCRIBERS>`:
atat/src/urc_channel.rs#L24
warning: you should consider adding a `Default` implementation for `UrcChannel<Urc, CAPACITY, SUBSCRIBERS>`
--> atat/src/urc_channel.rs:24:5
|
24 | / pub const fn new() -> Self {
25 | | Self(PubSubChannel::new())
26 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
|
21 + impl<Urc: AtatUrc, const CAPACITY: usize, const SUBSCRIBERS: usize> Default for UrcChannel<Urc, CAPACITY, SUBSCRIBERS> {
22 + fn default() -> Self {
23 + Self::new()
24 + }
25 + }
|
|
matching over `()` is more explicit:
atat/src/traits.rs#L114
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
|
temporary with significant `Drop` can be early dropped:
atat/src/response_slot.rs#L80
warning: temporary with significant `Drop` can be early dropped
--> atat/src/response_slot.rs:80:17
|
79 | / {
80 | | let buf = self.0.try_lock().unwrap();
| | ^^^
81 | | let mut res = buf.borrow_mut();
82 | | *res = response.into();
83 | | }
| |_________- temporary `buf` is currently being dropped at the end of its contained scope
|
= note: this might lead to unnecessary resource contention
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
help: merge the temporary construction with its single usage
|
80 ~
81 + let res = self.0.try_lock().unwrap().borrow_mut();
|
help: remove separated single usage
|
81 - let mut res = buf.borrow_mut();
81 +
|
|
temporary with significant `Drop` can be early dropped:
atat/src/response_slot.rs#L60
warning: temporary with significant `Drop` can be early dropped
--> atat/src/response_slot.rs:60:17
|
59 | / {
60 | | let buf = self.0.try_lock().unwrap();
| | ^^^
61 | | let mut res = buf.borrow_mut();
62 | | *res = Response::Prompt(prompt);
63 | | }
| |_________- temporary `buf` is currently being dropped at the end of its contained scope
|
= note: this might lead to unnecessary resource contention
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#significant_drop_tightening
= note: `-W clippy::significant-drop-tightening` implied by `-W clippy::nursery`
= help: to override `-W clippy::nursery` add `#[allow(clippy::significant_drop_tightening)]`
help: merge the temporary construction with its single usage
|
60 ~
61 + let res = self.0.try_lock().unwrap().borrow_mut();
|
help: remove separated single usage
|
61 - let mut res = buf.borrow_mut();
61 +
|
|
docs for function which may panic missing `# Panics` section:
atat/src/response_slot.rs#L44
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
|
the following explicit lifetimes could be elided: 'a:
atat/src/response_slot.rs#L44
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>> {
|
|
docs for function which may panic missing `# Panics` section:
atat/src/response_slot.rs#L36
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
|
the following explicit lifetimes could be elided: 'a:
atat/src/response_slot.rs#L36
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)]`
|
this method could have a `#[must_use]` attribute:
atat/src/response_slot.rs#L23
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
|
you should consider adding a `Default` implementation for `ResponseSlot<N>`:
atat/src/response_slot.rs#L23
warning: you should consider adding a `Default` implementation for `ResponseSlot<N>`
--> atat/src/response_slot.rs:23:5
|
23 | / pub const fn new() -> Self {
24 | | Self(
25 | | Mutex::new(RefCell::new(Response::Ok(Vec::new()))),
26 | | Signal::new(),
27 | | )
28 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `-W clippy::new-without-default` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::new_without_default)]`
help: try adding this
|
22 + impl<const N: usize> Default for ResponseSlot<N> {
23 + fn default() -> Self {
24 + Self::new()
25 + }
26 + }
|
|
use of a fallible conversion when an infallible one could be used:
atat/src/response.rs#L75
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()))
| ^^^^^^^^^^^^^^^^^^^
|
= 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
help: use
|
75 - Err(InternalError::ConnectionError((*e).try_into().unwrap()))
75 + Err(InternalError::ConnectionError((*e).into()))
|
|
use of a fallible conversion when an infallible one could be used:
atat/src/response.rs#L73
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())),
| ^^^^^^^^^^^^^^^^^^^
|
= 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
help: use
|
73 - Response::CmsError(e) => Err(InternalError::CmsError((*e).try_into().unwrap())),
73 + Response::CmsError(e) => Err(InternalError::CmsError((*e).into())),
|
|
use of a fallible conversion when an infallible one could be used:
atat/src/response.rs#L72
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())),
| ^^^^^^^^^^^^^^^^^^^
|
= 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)]`
help: use
|
72 - Response::CmeError(e) => Err(InternalError::CmeError((*e).try_into().unwrap())),
72 + Response::CmeError(e) => Err(InternalError::CmeError((*e).into())),
|
|
docs for function which may panic missing `# Panics` section:
atat/src/response.rs#L22
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
|
this method could have a `#[must_use]` attribute:
atat/src/response.rs#L22
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
|
you are deriving `PartialEq` and can implement `Eq`:
atat/src/response.rs#L4
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
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/ingress.rs#L263
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
|
future cannot be sent between threads safely:
atat/src/ingress.rs#L215
warning: future cannot be sent between threads safely
--> atat/src/ingress.rs:215:5
|
215 | async fn advance(&mut self, commit: usize) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `advance` is not `Send`
|
note: future is not `Send` as this value is used across an await
--> atat/src/ingress.rs:252:61
|
242 | if let Some(urc) = Urc::parse(urc_line) {
| -------------------- has type `core::option::Option<<Urc as traits::AtatUrc>::Response>` which is not `Send`
...
252 | self.urc_publisher.publish(urc).await;
| ^^^^^ await occurs here, with `Urc::parse(urc_line)` maybe used later
= note: `<Urc as traits::AtatUrc>::Response` doesn't implement `core::marker::Send`
note: future is not `Send` as this value is used across an await
--> atat/src/ingress.rs:252:61
|
215 | async fn advance(&mut self, commit: usize) {
| --------- has type `&mut ingress::Ingress<'_, D, Urc, RES_BUF_SIZE, URC_CAPACITY, URC_SUBSCRIBERS>` which is not `Send`
...
252 | self.urc_publisher.publish(urc).await;
| ^^^^^ await occurs here, with `&mut self` maybe used later
= note: `D` doesn't implement `core::marker::Send`
note: future is not `Send` as it awaits another future which is not `Send`
--> atat/src/ingress.rs:252:29
|
252 | ... self.urc_publisher.publish(urc).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `embassy_sync::pubsub::publisher::PublisherWaitFuture<'_, '_, embassy_sync::pubsub::PubSubChannel<embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex, <Urc as traits::AtatUrc>::Response, URC_CAPACITY, URC_SUBSCRIBERS, 1>, <Urc as traits::AtatUrc>::Response>`, which is not `Send`
= note: `<Urc as traits::AtatUrc>::Response` doesn't implement `core::marker::Sync`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
= note: `-W clippy::future-not-send` implied by `-W clippy::nursery`
= help: to override `-W clippy::nursery` add `#[allow(clippy::future_not_send)]`
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/ingress.rs#L179
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)]`
|
docs for function which may panic missing `# Panics` section:
atat/src/ingress.rs#L102
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)]`
|
you are deriving `PartialEq` and can implement `Eq`:
atat/src/ingress.rs#L6
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)]`
|
this method could have a `#[must_use]` attribute:
atat/src/error/cms_error.rs#L88
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
|
this method could have a `#[must_use]` attribute:
atat/src/error/cme_error.rs#L506
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
|
use Option::map_or_else instead of an if let/else:
atat/src/digest.rs#L478
warning: use Option::map_or_else instead of an if let/else
--> atat/src/digest.rs:478:9
|
478 | / match x.iter().position(|&x| x != b' ') {
479 | | Some(offset) => &x[offset..],
480 | | None => &x[0..0],
481 | | }
| |_________^ 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)]`
|
this function could have a `#[must_use]` attribute:
atat/src/digest.rs#L477
warning: this function could have a `#[must_use]` attribute
--> atat/src/digest.rs:477:5
|
477 | 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
= note: `-W clippy::must-use-candidate` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::must_use_candidate)]`
|
this could be rewritten as `let...else`:
atat/src/digest.rs#L469
warning: this could be rewritten as `let...else`
--> atat/src/digest.rs:469:9
|
469 | / let from = match x.iter().position(|x| !x.is_ascii_whitespace()) {
470 | | Some(i) => i,
471 | | None => return &x[0..0],
472 | | };
| |__________^ 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)]`
|
`iter` call on a collection with only one item:
atat_derive/src/helpers.rs#L55
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)]`
|
matching over `()` is more explicit:
atat/src/digest.rs#L408
warning: matching over `()` is more explicit
--> atat/src/digest.rs:408:35
|
408 | let (i, (prefix_data, _, error_msg)) = tuple((
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `-W clippy::ignored-unit-patterns` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::ignored_unit_patterns)]`
|
item in documentation is missing backticks:
atat/src/digest.rs#L36
warning: item in documentation is missing backticks
--> atat/src/digest.rs:36:54
|
36 | /// - if a URC exists but is incomplete, return [ParseError::Incomplete]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
36 | /// - if a URC exists but is incomplete, return [`ParseError::Incomplete`]
| ~~~~~~~~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
atat/src/digest.rs#L35
warning: item in documentation is missing backticks
--> atat/src/digest.rs:35:37
|
35 | /// - if no URC exists, return [ParseError::NoMatch]
| ^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
|
35 | /// - if no URC exists, return [`ParseError::NoMatch`]
| ~~~~~~~~~~~~~~~~~~~~~
|
method `into_result` is never used:
atat/src/fmt.rs#L226
warning: method `into_result` is never used
--> atat/src/fmt.rs:226:8
|
223 | pub trait Try {
| --- method in this trait
...
226 | fn into_result(self) -> Result<Self::Ok, Self::Error>;
| ^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L93
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:93:17
|
93 | let parse = if let Some(parse) = parse {
| _________________^
94 | | quote! {
95 | | #[inline]
96 | | fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
... |
116 | | }
117 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
93 ~ let parse = parse.map_or_else(|| quote! {
94 + #[inline]
95 + fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
96 + match res {
97 + Ok(resp) => atat::serde_at::from_slice::<#resp>(resp).map_err(|e| {
98 + atat::Error::Parse
99 + }),
100 + Err(e) => Err(e.into())
101 + }
102 + }
103 + }, |parse| quote! {
104 + #[inline]
105 + fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
106 + match res {
107 + Ok(resp) => #parse(resp).map_err(|e| {
108 + atat::Error::Parse
109 + }),
110 + Err(e) => Err(e.into())
111 + }
112 + }
113 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L64
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:64:34
|
64 | let reattempt_on_parse_err = match reattempt_on_parse_err {
| __________________________________^
65 | | Some(reattempt_on_parse_err) => {
66 | | quote! {
67 | | const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
... |
70 | | None => quote! {},
71 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
64 ~ let reattempt_on_parse_err = reattempt_on_parse_err.map_or_else(|| quote! {}, |reattempt_on_parse_err| quote! {
65 + const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
66 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L55
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:55:20
|
55 | let attempts = match attempts {
| ____________________^
56 | | Some(attempts) => {
57 | | quote! {
58 | | const ATTEMPTS: u8 = #attempts;
... |
61 | | None => quote! {},
62 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
55 ~ let attempts = attempts.map_or_else(|| quote! {}, |attempts| quote! {
56 + const ATTEMPTS: u8 = #attempts;
57 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L46
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:46:21
|
46 | let abortable = match abortable {
| _____________________^
47 | | Some(abortable) => {
48 | | quote! {
49 | | const CAN_ABORT: bool = #abortable;
... |
52 | | None => quote! {},
53 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
46 ~ let abortable = abortable.map_or_else(|| quote! {}, |abortable| quote! {
47 + const CAN_ABORT: bool = #abortable;
48 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L37
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:37:19
|
37 | let timeout = match timeout_ms {
| ___________________^
38 | | Some(timeout_ms) => {
39 | | quote! {
40 | | const MAX_TIMEOUT_MS: u32 = #timeout_ms;
... |
43 | | None => quote! {},
44 | | };
| |_____^
|
= 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)]`
help: try
|
37 ~ let timeout = timeout_ms.map_or_else(|| quote! {}, |timeout_ms| quote! {
38 + const MAX_TIMEOUT_MS: u32 = #timeout_ms;
39 ~ });
|
|
reference as raw pointer:
serde_at/src/lib.rs#L43
warning: reference as raw pointer
--> serde_at/src/lib.rs:43:17
|
43 | unsafe { &*(slice as *const [MaybeUninit<T>] as *const [T]) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<[MaybeUninit<T>]>(slice)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
= note: `-W clippy::ref-as-ptr` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_as_ptr)]`
|
unnecessary boolean `not` operation:
serde_at/src/ser/mod.rs#L411
warning: unnecessary boolean `not` operation
--> serde_at/src/ser/mod.rs:411:26
|
411 | let ser_struct = if !self.nested_struct {
| __________________________^
412 | | // all calls to serialize_struct after this one will be nested structs
413 | | self.nested_struct = true;
414 | | self.extend_from_slice(self.options.cmd_prefix.as_bytes())?;
... |
418 | | SerializeStruct::new(self, true)
419 | | };
| |_________^
|
= 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)]`
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:52
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
574 | /// deserialize_tuple is (mis)used for parsing `LengthDelimited` types.
| ~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:9
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
|
574 | /// `deserialize_tuple` is (mis)used for parsing LengthDelimited types.
| ~~~~~~~~~~~~~~~~~~~
|
redundant field names in struct initialization:
serde_at/src/ser/mod.rs#L190
warning: redundant field names in struct initialization
--> serde_at/src/ser/mod.rs:190:13
|
190 | buf: buf,
| ^^^^^^^^ help: replace it with: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `-W clippy::redundant-field-names` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_field_names)]`
|
redundant else block:
serde_at/src/de/mod.rs#L129
warning: redundant else block
--> serde_at/src/de/mod.rs:129:16
|
129 | } else {
| ________________^
130 | | loop {
131 | | match self.peek() {
132 | | Some(b'"') => {
... |
170 | | }
171 | | }
| |_________^
|
= help: remove the `else` block and move the contents out
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
= note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]`
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/urc.rs#L53
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/urc.rs:53:26
|
53 | let digest_arm = if let Some(parse_fn) = parse {
| __________________________^
54 | | quote! {
55 | | #parse_fn(&#code[..]),
56 | | }
... |
60 | | }
61 | | };
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
53 ~ let digest_arm = parse.map_or_else(|| quote! {
54 + atat::digest::parser::urc_helper(&#code[..]),
55 + }, |parse_fn| quote! {
56 + #parse_fn(&#code[..]),
57 ~ });
|
|
`iter` call on a collection with only one item:
atat_derive/src/helpers.rs#L55
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)]`
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L93
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:93:17
|
93 | let parse = if let Some(parse) = parse {
| _________________^
94 | | quote! {
95 | | #[inline]
96 | | fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
... |
116 | | }
117 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
93 ~ let parse = parse.map_or_else(|| quote! {
94 + #[inline]
95 + fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
96 + match res {
97 + Ok(resp) => atat::serde_at::from_slice::<#resp>(resp).map_err(|e| {
98 + atat::Error::Parse
99 + }),
100 + Err(e) => Err(e.into())
101 + }
102 + }
103 + }, |parse| quote! {
104 + #[inline]
105 + fn parse(&self, res: Result<&[u8], atat::InternalError>) -> core::result::Result<Self::Response, atat::Error> {
106 + match res {
107 + Ok(resp) => #parse(resp).map_err(|e| {
108 + atat::Error::Parse
109 + }),
110 + Err(e) => Err(e.into())
111 + }
112 + }
113 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L64
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:64:34
|
64 | let reattempt_on_parse_err = match reattempt_on_parse_err {
| __________________________________^
65 | | Some(reattempt_on_parse_err) => {
66 | | quote! {
67 | | const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
... |
70 | | None => quote! {},
71 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
64 ~ let reattempt_on_parse_err = reattempt_on_parse_err.map_or_else(|| quote! {}, |reattempt_on_parse_err| quote! {
65 + const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
66 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L55
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:55:20
|
55 | let attempts = match attempts {
| ____________________^
56 | | Some(attempts) => {
57 | | quote! {
58 | | const ATTEMPTS: u8 = #attempts;
... |
61 | | None => quote! {},
62 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
55 ~ let attempts = attempts.map_or_else(|| quote! {}, |attempts| quote! {
56 + const ATTEMPTS: u8 = #attempts;
57 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L46
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:46:21
|
46 | let abortable = match abortable {
| _____________________^
47 | | Some(abortable) => {
48 | | quote! {
49 | | const CAN_ABORT: bool = #abortable;
... |
52 | | None => quote! {},
53 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
46 ~ let abortable = abortable.map_or_else(|| quote! {}, |abortable| quote! {
47 + const CAN_ABORT: bool = #abortable;
48 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L37
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:37:19
|
37 | let timeout = match timeout_ms {
| ___________________^
38 | | Some(timeout_ms) => {
39 | | quote! {
40 | | const MAX_TIMEOUT_MS: u32 = #timeout_ms;
... |
43 | | None => quote! {},
44 | | };
| |_____^
|
= 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)]`
help: try
|
37 ~ let timeout = timeout_ms.map_or_else(|| quote! {}, |timeout_ms| quote! {
38 + const MAX_TIMEOUT_MS: u32 = #timeout_ms;
39 ~ });
|
|
reference as raw pointer:
serde_at/src/lib.rs#L43
warning: reference as raw pointer
--> serde_at/src/lib.rs:43:17
|
43 | unsafe { &*(slice as *const [MaybeUninit<T>] as *const [T]) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<[MaybeUninit<T>]>(slice)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
= note: `-W clippy::ref-as-ptr` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_as_ptr)]`
|
unnecessary boolean `not` operation:
serde_at/src/ser/mod.rs#L411
warning: unnecessary boolean `not` operation
--> serde_at/src/ser/mod.rs:411:26
|
411 | let ser_struct = if !self.nested_struct {
| __________________________^
412 | | // all calls to serialize_struct after this one will be nested structs
413 | | self.nested_struct = true;
414 | | self.extend_from_slice(self.options.cmd_prefix.as_bytes())?;
... |
418 | | SerializeStruct::new(self, true)
419 | | };
| |_________^
|
= 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)]`
|
reference as raw pointer:
serde_at/src/lib.rs#L43
warning: reference as raw pointer
--> serde_at/src/lib.rs:43:17
|
43 | unsafe { &*(slice as *const [MaybeUninit<T>] as *const [T]) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `core::ptr::from_ref::<[MaybeUninit<T>]>(slice)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ref_as_ptr
= note: `-W clippy::ref-as-ptr` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::ref_as_ptr)]`
|
unnecessary boolean `not` operation:
serde_at/src/ser/mod.rs#L411
warning: unnecessary boolean `not` operation
--> serde_at/src/ser/mod.rs:411:26
|
411 | let ser_struct = if !self.nested_struct {
| __________________________^
412 | | // all calls to serialize_struct after this one will be nested structs
413 | | self.nested_struct = true;
414 | | self.extend_from_slice(self.options.cmd_prefix.as_bytes())?;
... |
418 | | SerializeStruct::new(self, true)
419 | | };
| |_________^
|
= 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)]`
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:52
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
574 | /// deserialize_tuple is (mis)used for parsing `LengthDelimited` types.
| ~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:9
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
|
574 | /// `deserialize_tuple` is (mis)used for parsing LengthDelimited types.
| ~~~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:52
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
574 | /// deserialize_tuple is (mis)used for parsing `LengthDelimited` types.
| ~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
serde_at/src/de/mod.rs#L574
warning: item in documentation is missing backticks
--> serde_at/src/de/mod.rs:574:9
|
574 | /// deserialize_tuple is (mis)used for parsing LengthDelimited types.
| ^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
= note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]`
help: try
|
574 | /// `deserialize_tuple` is (mis)used for parsing LengthDelimited types.
| ~~~~~~~~~~~~~~~~~~~
|
redundant field names in struct initialization:
serde_at/src/ser/mod.rs#L190
warning: redundant field names in struct initialization
--> serde_at/src/ser/mod.rs:190:13
|
190 | buf: buf,
| ^^^^^^^^ help: replace it with: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `-W clippy::redundant-field-names` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_field_names)]`
|
redundant else block:
serde_at/src/de/mod.rs#L129
warning: redundant else block
--> serde_at/src/de/mod.rs:129:16
|
129 | } else {
| ________________^
130 | | loop {
131 | | match self.peek() {
132 | | Some(b'"') => {
... |
170 | | }
171 | | }
| |_________^
|
= help: remove the `else` block and move the contents out
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
= note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]`
|
redundant field names in struct initialization:
serde_at/src/ser/mod.rs#L190
warning: redundant field names in struct initialization
--> serde_at/src/ser/mod.rs:190:13
|
190 | buf: buf,
| ^^^^^^^^ help: replace it with: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `-W clippy::redundant-field-names` implied by `-W clippy::all`
= help: to override `-W clippy::all` add `#[allow(clippy::redundant_field_names)]`
|
redundant else block:
serde_at/src/de/mod.rs#L129
warning: redundant else block
--> serde_at/src/de/mod.rs:129:16
|
129 | } else {
| ________________^
130 | | loop {
131 | | match self.peek() {
132 | | Some(b'"') => {
... |
170 | | }
171 | | }
| |_________^
|
= help: remove the `else` block and move the contents out
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
= note: `-W clippy::redundant-else` implied by `-W clippy::pedantic`
= help: to override `-W clippy::pedantic` add `#[allow(clippy::redundant_else)]`
|