Skip to content
GitHub Actions / clippy succeeded May 3, 2024 in 4s

clippy

289 warnings

Details

Results

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

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956 2024-04-29)

Annotations

Check warning on line 115 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary structure name repetition

warning: unnecessary structure name repetition
   --> mqttrust_core/src/lib.rs:115:9
    |
115 |         EventError::MqttState(e)
    |         ^^^^^^^^^^ help: use the applicable keyword: `Self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

Check warning on line 109 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary structure name repetition

warning: unnecessary structure name repetition
   --> mqttrust_core/src/lib.rs:109:9
    |
109 |         EventError::Encoding(e)
    |         ^^^^^^^^^^ help: use the applicable keyword: `Self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

Check warning on line 95 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

warning: you are deriving `PartialEq` and can implement `Eq`
  --> mqttrust_core/src/lib.rs:95:17
   |
95 | #[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

Check warning on line 74 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

matching over `()` is more explicit

warning: matching over `()` is more explicit
  --> mqttrust_core/src/lib.rs:74:58
   |
74 |             payload: Vec::from_slice(p.payload).map_err(|_| {
   |                                                          ^ 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)]`

Check warning on line 69 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary structure name repetition

warning: unnecessary structure name repetition
  --> mqttrust_core/src/lib.rs:69:12
   |
69 |         Ok(PublishNotification {
   |            ^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self

Check warning on line 27 in mqttrust_core/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

warning: you are deriving `PartialEq` and can implement `Eq`
  --> mqttrust_core/src/lib.rs:27:17
   |
27 | #[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

Check warning on line 484 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'b

warning: the following explicit lifetimes could be elided: 'b
   --> mqttrust_core/src/state.rs:484:26
    |
484 |     pub(crate) fn packet<'b>(&'b mut self, pid: u16) -> Result<&'b [u8], StateError> {
    |                          ^^   ^^                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
484 -     pub(crate) fn packet<'b>(&'b mut self, pid: u16) -> Result<&'b [u8], StateError> {
484 +     pub(crate) fn packet(&mut self, pid: u16) -> Result<&[u8], StateError> {
    |

Check warning on line 457 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> mqttrust_core/src/state.rs:457:31
    |
457 |     /// A publish of non-zero QoS.
    |                               ^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
457 |     /// A publish of non-zero `QoS`.
    |                               ~~~~~

Check warning on line 456 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

pub(crate) struct inside private module

warning: pub(crate) struct inside private module
   --> mqttrust_core/src/state.rs:456:1
    |
456 | pub(crate) struct Inflight<const TIMER_HZ: u32, const L: usize> {
    | ----------^^^^^^^^^^^^^^^^
    | |
    | help: consider using: `pub`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate
    = note: `-W clippy::redundant-pub-crate` implied by `-W clippy::nursery`
    = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_pub_crate)]`

Check warning on line 450 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use Option::map_or instead of an if let/else

warning: use Option::map_or instead of an if let/else
   --> mqttrust_core/src/state.rs:445:9
    |
445 | /         if let Some(start_time) = self.0 {
446 | |             let elapse_time = start_time + interval;
447 | |             elapse_time <= *now
448 | |         } else {
449 | |             false
450 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
help: try
    |
445 ~         self.0.map_or(false, |start_time| {
446 +             let elapse_time = start_time + interval;
447 +             elapse_time <= *now
448 +         })
    |

Check warning on line 442 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)

warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
   --> mqttrust_core/src/state.rs:442:14
    |
442 |         now: &TimerInstantU32<TIMER_HZ>,
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `TimerInstantU32<TIMER_HZ>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

Check warning on line 441 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)

warning: this argument (8 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
   --> mqttrust_core/src/state.rs:441:9
    |
441 |         &self,
    |         ^^^^^ help: consider passing by value instead: `self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref

Check warning on line 360 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessarily wrapped by `Result`

warning: this function's return value is unnecessarily wrapped by `Result`
   --> mqttrust_core/src/state.rs:354:5
    |
354 | /     fn handle_incoming_pingresp(
355 | |         &mut self,
356 | |     ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
357 | |         self.await_pingresp = false;
358 | |         trace!("Received Pingresp");
359 | |         Ok((None, None))
360 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
help: remove `Result` from the return type...
    |
356 |     ) -> (core::option::Option<Notification>, core::option::Option<mqttrust::Packet<'static>>) {
    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and then change returning expressions
    |
359 |         (None, None)
    |

Check warning on line 335 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessarily wrapped by `Result`

warning: this function's return value is unnecessarily wrapped by `Result`
   --> mqttrust_core/src/state.rs:321:5
    |
321 | /     fn handle_incoming_pubcomp(
322 | |         &mut self,
323 | |         pid: Pid,
324 | |     ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
...   |
334 | |         }
335 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
help: remove `Result` from the return type...
    |
324 |     ) -> (core::option::Option<Notification>, core::option::Option<mqttrust::Packet<'static>>) {
    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and then change returning expressions
    |
329 ~             (notification, reply)
330 |         } else {
331 |             error!("Unsolicited pubcomp packet: {:?}", pid.get());
332 |             // Err(StateError::Unsolicited)
333 ~             (None, None)
    |

Check warning on line 319 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessarily wrapped by `Result`

warning: this function's return value is unnecessarily wrapped by `Result`
   --> mqttrust_core/src/state.rs:306:5
    |
306 | /     fn handle_incoming_pubrel(
307 | |         &mut self,
308 | |         pid: Pid,
309 | |     ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
...   |
318 | |         }
319 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
help: remove `Result` from the return type...
    |
309 |     ) -> (core::option::Option<Notification>, core::option::Option<mqttrust::Packet<'static>>) {
    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and then change returning expressions
    |
313 ~             (None, Some(reply))
314 |         } else {
315 |             error!("Unsolicited pubrel packet: {:?}", pid.get());
316 |             // Err(StateError::Unsolicited)
317 ~             (None, None)
    |

Check warning on line 264 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> mqttrust_core/src/state.rs:264:51
    |
264 |     /// in case of QoS1 and Replys rec in case of QoS while also storing the message
    |                                                   ^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
264 |     /// in case of QoS1 and Replys rec in case of `QoS` while also storing the message
    |                                                   ~~~~~

Check warning on line 264 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> mqttrust_core/src/state.rs:264:20
    |
264 |     /// in case of QoS1 and Replys rec in case of QoS while also storing the message
    |                    ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
264 |     /// in case of `QoS1` and Replys rec in case of QoS while also storing the message
    |                    ~~~~~~

Check warning on line 263 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

warning: item in documentation is missing backticks
   --> mqttrust_core/src/state.rs:263:54
    |
263 |     /// Results in a publish notification in all the QoS cases. Replys with an ack
    |                                                      ^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
    |
263 |     /// Results in a publish notification in all the `QoS` cases. Replys with an ack
    |                                                      ~~~~~

Check warning on line 265 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'b

warning: the following explicit lifetimes could be elided: 'b
   --> mqttrust_core/src/state.rs:265:32
    |
265 |     fn handle_incoming_publish<'b>(
    |                                ^^
266 |         &mut self,
267 |         publish: Publish<'b>,
    |                          ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
265 ~     fn handle_incoming_publish(
266 |         &mut self,
267 ~         publish: Publish<'_>,
    |

Check warning on line 237 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessarily wrapped by `Result`

warning: this function's return value is unnecessarily wrapped by `Result`
   --> mqttrust_core/src/state.rs:229:5
    |
229 | /     fn handle_incoming_unsuback(
230 | |         &mut self,
231 | |         pid: Pid,
232 | |     ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
...   |
236 | |         Ok((notification, request))
237 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
help: remove `Result` from the return type...
    |
232 |     ) -> (core::option::Option<Notification>, core::option::Option<mqttrust::Packet<'static>>) {
    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and then change returning expressions
    |
236 |         (notification, request)
    |

Check warning on line 230 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `self` argument

warning: unused `self` argument
   --> mqttrust_core/src/state.rs:230:9
    |
230 |         &mut self,
    |         ^^^^^^^^^
    |
    = help: consider refactoring to an associated function
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self

Check warning on line 227 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function's return value is unnecessarily wrapped by `Result`

warning: this function's return value is unnecessarily wrapped by `Result`
   --> mqttrust_core/src/state.rs:218:5
    |
218 | /     fn handle_incoming_suback<'a>(
219 | |         &mut self,
220 | |         suback: Suback<'a>,
221 | |     ) -> Result<(Option<Notification>, Option<Packet<'static>>), StateError> {
...   |
226 | |         Ok((notification, request))
227 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
help: remove `Result` from the return type...
    |
221 |     ) -> (core::option::Option<Notification>, core::option::Option<mqttrust::Packet<'static>>) {
    |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and then change returning expressions
    |
226 |         (notification, request)
    |

Check warning on line 220 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument is passed by value, but not consumed in the function body

warning: this argument is passed by value, but not consumed in the function body
   --> mqttrust_core/src/state.rs:220:17
    |
220 |         suback: Suback<'a>,
    |                 ^^^^^^^^^^ help: consider taking a reference instead: `&Suback<'a>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value

Check warning on line 219 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `self` argument

warning: unused `self` argument
   --> mqttrust_core/src/state.rs:219:9
    |
219 |         &mut self,
    |         ^^^^^^^^^
    |
    = help: consider refactoring to an associated function
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_self
    = note: `-W clippy::unused-self` implied by `-W clippy::pedantic`
    = help: to override `-W clippy::pedantic` add `#[allow(clippy::unused_self)]`

Check warning on line 218 in mqttrust_core/src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> mqttrust_core/src/state.rs:218:31
    |
218 |     fn handle_incoming_suback<'a>(
    |                               ^^
219 |         &mut self,
220 |         suback: Suback<'a>,
    |                        ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
218 ~     fn handle_incoming_suback(
219 |         &mut self,
220 ~         suback: Suback<'_>,
    |