Skip to content

Ack System

Ack System #217

GitHub Actions / clippy succeeded Mar 2, 2024 in 1s

clippy

74 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 74
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 64 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

empty `loop {}` wastes CPU cycles

warning: empty `loop {}` wastes CPU cycles
  --> boards/sensor_v2/src/main.rs:64:9
   |
64 |         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 26 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `data_manager` is never read

warning: field `data_manager` is never read
  --> boards/sensor_v2/src/main.rs:26:9
   |
26 |         data_manager: DataManager,
   |         ^^^^^^^^^^^^
...
35 |     fn init(mut ctx: init::Context) -> (SharedResources, LocalResources, init::Monotonics) {
   |                                         --------------- field in this struct

Check warning on line 32 in boards/sensor_v2/src/data_manager.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

methods `clone_sensors` and `handle_data` are never used

warning: methods `clone_sensors` and `handle_data` are never used
  --> boards/sensor_v2/src/data_manager.rs:32:12
   |
19 | impl DataManager {
   | ---------------- methods in this implementation
...
32 |     pub fn clone_sensors(&self) -> [Option<SensorData>; 10] {
   |            ^^^^^^^^^^^^^
...
47 |     pub fn handle_data(&mut self, data: Message) -> Result<(), HydraError> {
   |            ^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 68 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
  --> boards/sensor_v2/src/main.rs:68:21
   |
68 |     fn sleep_system(mut cx: sleep_system::Context) {
   |                     ----^^
   |                     |
   |                     help: remove this `mut`

Check warning on line 68 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cx`

warning: unused variable: `cx`
  --> boards/sensor_v2/src/main.rs:68:25
   |
68 |     fn sleep_system(mut cx: sleep_system::Context) {
   |                         ^^ help: if this is intentional, prefix it with an underscore: `_cx`

Check warning on line 63 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
  --> boards/sensor_v2/src/main.rs:63:13
   |
63 |     fn idle(mut ctx: idle::Context) -> ! {
   |             ----^^^
   |             |
   |             help: remove this `mut`

Check warning on line 63 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `ctx`

warning: unused variable: `ctx`
  --> boards/sensor_v2/src/main.rs:63:17
   |
63 |     fn idle(mut ctx: idle::Context) -> ! {
   |                 ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`

Check warning on line 49 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
  --> boards/sensor_v2/src/main.rs:49:13
   |
49 |         let mut button = gpioc.pc13.into_floating_input();
   |             ----^^^^^^
   |             |
   |             help: remove this `mut`

Check warning on line 35 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
  --> boards/sensor_v2/src/main.rs:35:13
   |
35 |     fn init(mut ctx: init::Context) -> (SharedResources, LocalResources, init::Monotonics) {
   |             ----^^^
   |             |
   |             help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

Check warning on line 16 in boards/sensor_v2/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `info`

warning: unused variable: `info`
  --> boards/sensor_v2/src/main.rs:16:10
   |
16 | fn panic(info: &core::panic::PanicInfo) -> ! {
   |          ^^^^ help: if this is intentional, prefix it with an underscore: `_info`
   |
   = note: `#[warn(unused_variables)]` on by default

Check warning on line 167 in boards/sensor/src/main.rs

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 127 in boards/camera/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

empty `loop {}` wastes CPU cycles

warning: empty `loop {}` wastes CPU cycles
   --> boards/camera/src/main.rs:127:9
    |
127 |         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 111 in boards/camera/src/state_machine/mod.rs

See this annotation in the file changed.

@github-actions 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/camera/src/state_machine/mod.rs:111:1
    |
111 | 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>`
    |
111 ~ impl From<RocketStates> for state::StateData {
112 ~     fn from(val: RocketStates) -> Self {
113 ~         match val {
    |

Check warning on line 486 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions 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 114 in boards/camera/src/data_manager.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> boards/camera/src/data_manager.rs:109:47
    |
109 |               messages::Data::Sensor(sensor) => match sensor.data {
    |  _______________________________________________^
110 | |                 messages::sensor::SensorData::Air(air_data) => {
111 | |                     self.air = Some(air_data);
112 | |                 }
113 | |                 _ => {}
114 | |             },
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try
    |
109 ~             messages::Data::Sensor(sensor) => if let messages::sensor::SensorData::Air(air_data) = sensor.data {
110 +                 self.air = Some(air_data);
111 ~             },
    |

Check warning on line 116 in boards/camera/src/data_manager.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`

warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> boards/camera/src/data_manager.rs:108:9
    |
108 | /         match data.data {
109 | |             messages::Data::Sensor(sensor) => match sensor.data {
110 | |                 messages::sensor::SensorData::Air(air_data) => {
111 | |                     self.air = Some(air_data);
...   |
115 | |             _ => {}
116 | |         }
    | |_________^
    |
    = 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
help: try
    |
108 ~         if let messages::Data::Sensor(sensor) = data.data { match sensor.data {
109 +             messages::sensor::SensorData::Air(air_data) => {
110 +                 self.air = Some(air_data);
111 +             }
112 +             _ => {}
113 +         } }
    |

Check warning on line 467 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions 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

Check warning on line 421 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> libraries/sbg-rs/src/sbg.rs:421:23
    |
421 |             Err(_) => return _SbgErrorCode_SBG_READ_ERROR,
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
421 |             Err(_) => _SbgErrorCode_SBG_READ_ERROR,
    |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 420 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> libraries/sbg-rs/src/sbg.rs:420:22
    |
420 |             Ok(_) => return _SbgErrorCode_SBG_NO_ERROR,
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
420 |             Ok(_) => _SbgErrorCode_SBG_NO_ERROR,
    |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 409 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unsafe function's docs miss `# Safety` section

warning: unsafe function's docs miss `# Safety` section
   --> libraries/sbg-rs/src/sbg.rs:406:5
    |
406 | /     pub unsafe extern "C" fn SbgFlushFunc(
407 | |         pInterface: *mut _SbgInterface,
408 | |         _flags: u32,
409 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

Check warning on line 360 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unsafe function's docs miss `# Safety` section

warning: unsafe function's docs miss `# Safety` section
   --> libraries/sbg-rs/src/sbg.rs:354:5
    |
354 | /     pub unsafe extern "C" fn SbgEComReceiveLogFunc(
355 | |         _pHandle: *mut _SbgEComHandle,
356 | |         msgClass: u32,
357 | |         msg: u32,
358 | |         pLogData: *const _SbgBinaryLogData,
359 | |         _pUserArg: *mut c_void,
360 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

Check warning on line 319 in libraries/sbg-rs/src/sbg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unsafe function's docs miss `# Safety` section

warning: unsafe function's docs miss `# Safety` section
   --> libraries/sbg-rs/src/sbg.rs:315:5
    |
315 | /     pub unsafe extern "C" fn SbgInterfaceWriteFunc(
316 | |         pInterface: *mut _SbgInterface,
317 | |         pBuffer: *const c_void,
318 | |         bytesToWrite: usize,
319 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc