Skip to content

Link Board GPS Module #322

Link Board GPS Module

Link Board GPS Module #322

GitHub Actions / clippy succeeded Jul 8, 2024 in 1s

clippy

95 warnings

Details

Results

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

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b9 2024-06-10)

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> {
   |            ^^^^^^^^^^^

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

See this annotation in the file changed.

@github-actions github-actions / clippy

multiple fields are never read

warning: multiple fields are never read
  --> boards/sensor_v2/src/data_manager.rs:10:9
   |
9  | pub struct DataManager {
   |            ----------- fields in this struct
10 |     pub air: Option<Air>,
   |         ^^^
11 |     pub ekf_nav: Option<(EkfNav1, EkfNav2)>,
   |         ^^^^^^^
12 |     pub ekf_quat: Option<EkfQuat>,
   |         ^^^^^^^^
13 |     pub imu: Option<(Imu1, Imu2)>,
   |         ^^^
14 |     pub utc_time: Option<UtcTime>,
   |         ^^^^^^^^
15 |     pub gps_vel: Option<GpsVel>,
   |         ^^^^^^^
16 |     pub gps_pos: Option<(GpsPos1, GpsPos2)>,
   |         ^^^^^^^
   |
   = note: `DataManager` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
   = 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 76 in boards/communication/src/main.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/communication/src/main.rs:62:21
   |
62 |           sd_manager: SdManager<
   |  _____________________^
63 | |             Spi<
64 | |                 Config<
65 | |                     Pads<
...  |
75 | |             Pin<PB14, Output<PushPull>>,
76 | |         >,
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 269 in boards/communication/src/main.rs

See this annotation in the file changed.

@github-actions 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:269:42
    |
269 |                 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 266 in boards/communication/src/main.rs

See this annotation in the file changed.

@github-actions 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:266:42
    |
266 |                 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 216 in boards/communication/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/communication/src/main.rs:216:9
    |
216 |         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

See this annotation in the file changed.

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

See this annotation in the file changed.

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

See this annotation in the file changed.

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

See this annotation in the file changed.

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

See this annotation in the file changed.

@github-actions 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 84 in boards/communication/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/communication/src/communication.rs:75:5
   |
75 | /     pub fn new<S>(
76 | |         can_rx: Pin<PA23, AlternateI>,
77 | |         can_tx: Pin<PA22, AlternateI>,
78 | |         pclk_can: Pclk<Can0, Gclk0Id>,
...  |
83 | |         loopback: bool,
84 | |     ) -> (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 70 in boards/communication/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/communication/src/communication.rs:65:14
   |
65 |       pub can: Can<
   |  ______________^
66 | |         'static,
67 | |         Can0,
68 | |         Dependencies<Can0, Gclk0Id, Pin<PA23, Alternate<I>>, Pin<PA22, Alternate<I>>, CAN0>,
69 | |         Capacities,
70 | |     >,
   | |_____^
   |
   = 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 61 in boards/communication/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `gps_device` is never read

warning: field `gps_device` is never read
  --> boards/communication/src/main.rs:61:9
   |
61 |         gps_device: gps::GpsDevice,
   |         ^^^^^^^^^^
...
86 |     fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
   |                                            ----- field in this struct

Check warning on line 16 in boards/communication/src/gps.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `uart` is never read

warning: field `uart` is never read
  --> boards/communication/src/gps.rs:16:9
   |
15 | pub struct GpsDevice {
   |            --------- field in this struct
16 |     pub uart: Uart<GpsUartConfig, Duplex>,
   |         ^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 144 in boards/recovery/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/recovery/src/main.rs:144:9
    |
144 |         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