Update embassy-time to 0.3 #206
audit.yml
on: push
Cancel previous runs
5s
security_audit
16s
Annotations
60 warnings
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
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)]`
|
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
|
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/client.rs#L110
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)]`
|
this expression creates a reference which is immediately dereferenced by the compiler:
atat/src/asynch/client.rs#L108
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)]`
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/asynch/client.rs#L101
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
|
matching over `()` is more explicit:
atat/src/asynch/client.rs#L83
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
|
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
|
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
|
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>> {
|
|
`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)]`
|
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
|
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()))
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
|
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())),
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
|
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())),
| ^^^^^^^^^^^^^^^^^^^ 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)]`
|
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#L262
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/ingress.rs:262:33
|
262 | ... debug!("Received OK ({}/{})", swallowed, self.pos,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `debug!("Received OK ({}/{})", swallowed, self.pos,);`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L63
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:63:34
|
63 | let reattempt_on_parse_err = match reattempt_on_parse_err {
| __________________________________^
64 | | Some(reattempt_on_parse_err) => {
65 | | quote! {
66 | | const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
... |
69 | | None => quote! {},
70 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
63 ~ let reattempt_on_parse_err = reattempt_on_parse_err.map_or_else(|| quote! {}, |reattempt_on_parse_err| quote! {
64 + const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
65 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L54
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:54:20
|
54 | let attempts = match attempts {
| ____________________^
55 | | Some(attempts) => {
56 | | quote! {
57 | | const ATTEMPTS: u8 = #attempts;
... |
60 | | None => quote! {},
61 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
54 ~ let attempts = attempts.map_or_else(|| quote! {}, |attempts| quote! {
55 + const ATTEMPTS: u8 = #attempts;
56 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L45
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:45:21
|
45 | let abortable = match abortable {
| _____________________^
46 | | Some(abortable) => {
47 | | quote! {
48 | | const CAN_ABORT: bool = #abortable;
... |
51 | | None => quote! {},
52 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
45 ~ let abortable = abortable.map_or_else(|| quote! {}, |abortable| quote! {
46 + const CAN_ABORT: bool = #abortable;
47 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L36
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:36:19
|
36 | let timeout = match timeout_ms {
| ___________________^
37 | | Some(timeout_ms) => {
38 | | quote! {
39 | | const MAX_TIMEOUT_MS: u32 = #timeout_ms;
... |
42 | | None => quote! {},
43 | | };
| |_____^
|
= 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
|
36 ~ let timeout = timeout_ms.map_or_else(|| quote! {}, |timeout_ms| quote! {
37 + const MAX_TIMEOUT_MS: u32 = #timeout_ms;
38 ~ });
|
|
consider adding a `;` to the last statement for consistent formatting:
atat/src/ingress.rs#L178
warning: consider adding a `;` to the last statement for consistent formatting
--> atat/src/ingress.rs:178:33
|
178 | ... 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 | | res_slot: &'a ResponseSlot<INGRESS_BUF_SIZE>,
105 | | urc_channel: &'a UrcChannel<Urc, URC_CAPACITY, URC_SUBSCRIBERS>,
106 | | ) -> Self {
| |_____________^
|
note: first possible panic found here
--> atat/src/ingress.rs:112:28
|
112 | 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#L477
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)]`
|
this function could have a `#[must_use]` attribute:
atat/src/digest.rs#L476
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
= 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#L468
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)]`
|
matching over `()` is more explicit:
atat/src/digest.rs#L407
warning: matching over `()` is more explicit
--> atat/src/digest.rs:407:35
|
407 | 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#L35
warning: item in documentation is missing backticks
--> atat/src/digest.rs:35:54
|
35 | /// - 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
|
35 | /// - if a URC exists but is incomplete, return [`ParseError::Incomplete`]
| ~~~~~~~~~~~~~~~~~~~~~~~~
|
item in documentation is missing backticks:
atat/src/digest.rs#L34
warning: item in documentation is missing backticks
--> atat/src/digest.rs:34:37
|
34 | /// - 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
|
34 | /// - if no URC exists, return [`ParseError::NoMatch`]
| ~~~~~~~~~~~~~~~~~~~~~
|
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)]`
|
`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#L63
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:63:34
|
63 | let reattempt_on_parse_err = match reattempt_on_parse_err {
| __________________________________^
64 | | Some(reattempt_on_parse_err) => {
65 | | quote! {
66 | | const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
... |
69 | | None => quote! {},
70 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
63 ~ let reattempt_on_parse_err = reattempt_on_parse_err.map_or_else(|| quote! {}, |reattempt_on_parse_err| quote! {
64 + const REATTEMPT_ON_PARSE_ERR: bool = #reattempt_on_parse_err;
65 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L54
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:54:20
|
54 | let attempts = match attempts {
| ____________________^
55 | | Some(attempts) => {
56 | | quote! {
57 | | const ATTEMPTS: u8 = #attempts;
... |
60 | | None => quote! {},
61 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
54 ~ let attempts = attempts.map_or_else(|| quote! {}, |attempts| quote! {
55 + const ATTEMPTS: u8 = #attempts;
56 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L45
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:45:21
|
45 | let abortable = match abortable {
| _____________________^
46 | | Some(abortable) => {
47 | | quote! {
48 | | const CAN_ABORT: bool = #abortable;
... |
51 | | None => quote! {},
52 | | };
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
|
45 ~ let abortable = abortable.map_or_else(|| quote! {}, |abortable| quote! {
46 + const CAN_ABORT: bool = #abortable;
47 ~ });
|
|
use Option::map_or_else instead of an if let/else:
atat_derive/src/cmd.rs#L36
warning: use Option::map_or_else instead of an if let/else
--> atat_derive/src/cmd.rs:36:19
|
36 | let timeout = match timeout_ms {
| ___________________^
37 | | Some(timeout_ms) => {
38 | | quote! {
39 | | const MAX_TIMEOUT_MS: u32 = #timeout_ms;
... |
42 | | None => quote! {},
43 | | };
| |_____^
|
= 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
|
36 ~ let timeout = timeout_ms.map_or_else(|| quote! {}, |timeout_ms| quote! {
37 + const MAX_TIMEOUT_MS: u32 = #timeout_ms;
38 ~ });
|
|
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)]`
|
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 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 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)]`
|