Use SBG sensor status #269
clippy
91 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 91 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.76.0 (07dca489a 2024-02-04)
- cargo 1.76.0 (c84b36747 2024-01-18)
- clippy 0.1.76 (07dca48 2024-02-04)
Annotations
Check warning on line 167 in boards/sensor/src/main.rs
github-actions / clippy
empty `loop {}` wastes CPU cycles
warning: empty `loop {}` wastes CPU cycles
--> boards/sensor/src/main.rs:167:9
|
167 | loop {}
| ^^^^^^^
|
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
= note: `#[warn(clippy::empty_loop)]` on by default
Check warning on line 134 in boards/sensor/src/sbg_manager.rs
github-actions / clippy
using `clone` on type `[u8; 1024]` which implements the `Copy` trait
warning: using `clone` on type `[u8; 1024]` which implements the `Copy` trait
--> boards/sensor/src/sbg_manager.rs:134:33
|
134 | let buf_clone = buf.clone();
| ^^^^^^^^^^^ help: try dereferencing it: `*buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 73 in boards/sensor/src/communication.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> boards/sensor/src/communication.rs:64:5
|
64 | / pub fn new<S>(
65 | | can_rx: Pin<PA23, AlternateI>,
66 | | can_tx: Pin<PA22, AlternateI>,
67 | | pclk_can: Pclk<Can0, Gclk0Id>,
... |
72 | | loopback: bool,
73 | | ) -> (Self, S::Inc)
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 59 in boards/sensor/src/communication.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> boards/sensor/src/communication.rs:54:14
|
54 | pub can: Can<
| ______________^
55 | | 'static,
56 | | Can0,
57 | | Dependencies<Can0, Gclk0Id, Pin<PA23, Alternate<I>>, Pin<PA22, Alternate<I>>, CAN0>,
58 | | Capacities,
59 | | >,
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
Check warning on line 74 in boards/communication/src/main.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> boards/communication/src/main.rs:60:21
|
60 | sd_manager: SdManager<
| _____________________^
61 | | Spi<
62 | | Config<
63 | | Pads<
... |
73 | | Pin<PB14, Output<PushPull>>,
74 | | >,
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
Check warning on line 253 in boards/communication/src/main.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> boards/communication/src/main.rs:253:42
|
253 | manager.write(&mut file, &msg_ser)?;
| ^^^^^^^^ help: change this to: `msg_ser`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 250 in boards/communication/src/main.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> boards/communication/src/main.rs:250:42
|
250 | manager.write(&mut file, &msg_ser)?;
| ^^^^^^^^ help: change this to: `msg_ser`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 200 in boards/communication/src/main.rs
github-actions / clippy
empty `loop {}` wastes CPU cycles
warning: empty `loop {}` wastes CPU cycles
--> boards/communication/src/main.rs:200:9
|
200 | loop {}
| ^^^^^^^
|
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
= note: `#[warn(clippy::empty_loop)]` on by default
Check warning on line 70 in boards/communication/src/health.rs
github-actions / clippy
this function has too many arguments (11/7)
warning: this function has too many arguments (11/7)
--> boards/communication/src/health.rs:58:5
|
58 | / pub fn new(
59 | | reader: Adc<ADC0>,
60 | | reader1: Adc<ADC1>,
61 | | pin_3v3: Pin<PB01, Alternate<B>>,
... |
69 | | pin_failover: Pin<PB05, Alternate<B>>,
70 | | ) -> Self {
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
Check warning on line 52 in boards/communication/src/data_manager.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> boards/communication/src/data_manager.rs:52:9
|
52 | return RadioRate::Slow;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
52 - return RadioRate::Slow;
52 + RadioRate::Slow
|
Check warning on line 311 in boards/communication/src/communication.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> boards/communication/src/communication.rs:311:13
|
311 | return Err(mavlink::error::MessageReadError::Io.into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
311 - return Err(mavlink::error::MessageReadError::Io.into());
311 + Err(mavlink::error::MessageReadError::Io.into())
|
Check warning on line 307 in boards/communication/src/communication.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> boards/communication/src/communication.rs:307:21
|
307 | return Err(mavlink::error::MessageReadError::Io.into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
307 - return Err(mavlink::error::MessageReadError::Io.into());
307 + Err(mavlink::error::MessageReadError::Io.into())
|
Check warning on line 302 in boards/communication/src/communication.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> boards/communication/src/communication.rs:302:21
|
302 | return Ok(postcard::from_bytes::<Message>(&msg.message)?);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
302 - return Ok(postcard::from_bytes::<Message>(&msg.message)?);
302 + Ok(postcard::from_bytes::<Message>(&msg.message)?)
|
Check warning on line 81 in boards/communication/src/communication.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> boards/communication/src/communication.rs:72:5
|
72 | / pub fn new<S>(
73 | | can_rx: Pin<PA23, AlternateI>,
74 | | can_tx: Pin<PA22, AlternateI>,
75 | | pclk_can: Pclk<Can0, Gclk0Id>,
... |
80 | | loopback: bool,
81 | | ) -> (Self, S::Inc)
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 67 in boards/communication/src/communication.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> boards/communication/src/communication.rs:62:14
|
62 | pub can: Can<
| ______________^
63 | | 'static,
64 | | Can0,
65 | | Dependencies<Can0, Gclk0Id, Pin<PA23, Alternate<I>>, Pin<PA22, Alternate<I>>, CAN0>,
66 | | Capacities,
67 | | >,
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
Check warning on line 113 in boards/power/src/main.rs
github-actions / clippy
empty `loop {}` wastes CPU cycles
warning: empty `loop {}` wastes CPU cycles
--> boards/power/src/main.rs:113:9
|
113 | loop {}
| ^^^^^^^
|
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
= note: `#[warn(clippy::empty_loop)]` on by default
Check warning on line 136 in boards/recovery/src/main.rs
github-actions / clippy
empty `loop {}` wastes CPU cycles
warning: empty `loop {}` wastes CPU cycles
--> boards/recovery/src/main.rs:136:9
|
136 | loop {}
| ^^^^^^^
|
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
= note: `#[warn(clippy::empty_loop)]` on by default
Check warning on line 106 in boards/recovery/src/state_machine/mod.rs
github-actions / clippy
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> boards/recovery/src/state_machine/mod.rs:106:1
|
106 | impl Into<state::StateData> for RocketStates {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<state_machine::RocketStates>`
|
106 ~ impl From<RocketStates> for state::StateData {
107 ~ fn from(val: RocketStates) -> Self {
108 ~ match val {
|
Check warning on line 69 in boards/power/src/communication.rs
github-actions / clippy
this function has too many arguments (8/7)
warning: this function has too many arguments (8/7)
--> boards/power/src/communication.rs:60:5
|
60 | / pub fn new<S>(
61 | | can_rx: Pin<PA23, AlternateI>,
62 | | can_tx: Pin<PA22, AlternateI>,
63 | | pclk_can: Pclk<Can0, Gclk0Id>,
... |
68 | | loopback: bool,
69 | | ) -> (Self, S::Inc)
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
Check warning on line 55 in boards/power/src/communication.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> boards/power/src/communication.rs:50:14
|
50 | pub can: Can<
| ______________^
51 | | 'static,
52 | | Can0,
53 | | Dependencies<Can0, Gclk0Id, Pin<PA23, Alternate<I>>, Pin<PA22, Alternate<I>>, CAN0>,
54 | | Capacities,
55 | | >,
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
Check warning on line 35 in boards/power/src/main.rs
github-actions / clippy
fields `data_manager` and `can0` are never read
warning: fields `data_manager` and `can0` are never read
--> boards/power/src/main.rs:35:9
|
35 | data_manager: DataManager,
| ^^^^^^^^^^^^
36 | can0: CanDevice0,
| ^^^^
...
52 | fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
| ------ fields in this struct
Check warning on line 10 in boards/power/src/data_manager.rs
github-actions / clippy
method `handle_data` is never used
warning: method `handle_data` is never used
--> boards/power/src/data_manager.rs:10:12
|
6 | impl DataManager {
| ---------------- method in this implementation
...
10 | pub fn handle_data(&mut self, _data: Message) {
| ^^^^^^^^^^^
Check warning on line 56 in boards/power/src/communication.rs
github-actions / clippy
field `line_interrupts` is never read
warning: field `line_interrupts` is never read
--> boards/power/src/communication.rs:56:5
|
49 | pub struct CanDevice0 {
| ---------- field in this struct
...
56 | line_interrupts: OwnedInterruptSet<Can0, EnabledLine0>,
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 486 in libraries/sbg-rs/src/sbg.rs
github-actions / clippy
you seem to be trying to use `match` for an equality check. Consider using `if`
warning: you seem to be trying to use `match` for an equality check. Consider using `if`
--> libraries/sbg-rs/src/sbg.rs:479:5
|
479 | / match logType {
480 | | // silently handle errors
481 | | // _SbgDebugLogType_SBG_DEBUG_LOG_TYPE_ERROR => error!("SBG Error"),
482 | | _SbgDebugLogType_SBG_DEBUG_LOG_TYPE_WARNING => warn!("SBG Warning"),
... |
485 | | _ => (),
486 | | };
| |_____^ help: try: `if logType == _SbgDebugLogType_SBG_DEBUG_LOG_TYPE_WARNING { warn!("SBG Warning") }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
Check warning on line 467 in libraries/sbg-rs/src/sbg.rs
github-actions / clippy
unsafe function's docs miss `# Safety` section
warning: unsafe function's docs miss `# Safety` section
--> libraries/sbg-rs/src/sbg.rs:459:1
|
459 | / pub unsafe extern "C" fn sbgPlatformDebugLogMsg(
460 | | _pFileName: *const ::core::ffi::c_char,
461 | | _pFunctionName: *const ::core::ffi::c_char,
462 | | _line: u32,
... |
466 | | _pFormat: *const ::core::ffi::c_char,
467 | | ) {
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc