Skip to content

make fields of log struct public #200

make fields of log struct public

make fields of log struct public #200

GitHub Actions / clippy succeeded Jan 16, 2024 in 1s

clippy

60 warnings

Details

Results

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

Versions

  • rustc 1.75.0 (82e1608df 2023-12-21)
  • cargo 1.75.0 (1d8b05cdd 2023-11-20)
  • clippy 0.1.75 (82e1608 2023-12-21)

Annotations

Check warning on line 166 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:166:9
    |
166 |         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 133 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:133:33
    |
133 |                 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 65 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:51:21
   |
51 |           sd_manager: SdManager<
   |  _____________________^
52 | |             Spi<
53 | |                 Config<
54 | |                     Pads<
...  |
64 | |             Pin<PB14, Output<PushPull>>,
65 | |         >,
   | |_________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 222 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:222:42
    |
222 |                 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 219 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:219:42
    |
219 |                 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 171 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:171:9
    |
171 |         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 109 in boards/communication/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/communication/src/data_manager.rs:104:49
    |
104 |               messages::Data::Command(command) => match command.data {
    |  _________________________________________________^
105 | |                 messages::command::CommandData::RadioRateChange(command_data) => {
106 | |                     self.logging_rate = Some(command_data.rate);
107 | |                 }
108 | |                 _ => {}
109 | |             },
    | |_____________^
    |
    = 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
    |
104 ~             messages::Data::Command(command) => if let messages::command::CommandData::RadioRateChange(command_data) = command.data {
105 +                 self.logging_rate = Some(command_data.rate);
106 ~             },
    |

Check warning on line 44 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:44:9
   |
44 |         return RadioRate::Slow;
   |         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
   |
44 -         return RadioRate::Slow;
44 +         RadioRate::Slow
   |

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:306:44
    |
306 |                   info!("Radio unknown msg");
    |  ____________________________________________^
307 | |                 return;
    | |______________________^
    |
    = 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`
    |
306 -                 info!("Radio unknown msg");
307 -                 return;
306 +                 info!("Radio unknown msg");
    |

Check warning on line 82 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:73:5
   |
73 | /     pub fn new<S>(
74 | |         can_rx: Pin<PA23, AlternateI>,
75 | |         can_tx: Pin<PA22, AlternateI>,
76 | |         pclk_can: Pclk<Can0, Gclk0Id>,
...  |
81 | |         loopback: bool,
82 | |     ) -> (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 68 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:63:14
   |
63 |       pub can: Can<
   |  ______________^
64 | |         'static,
65 | |         Can0,
66 | |         Dependencies<Can0, Gclk0Id, Pin<PA23, Alternate<I>>, Pin<PA22, Alternate<I>>, CAN0>,
67 | |         Capacities,
68 | |     >,
   | |_____^
   |
   = 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 66 in boards/communication/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

field `radio_manager` is never read

warning: field `radio_manager` is never read
  --> boards/communication/src/main.rs:66:9
   |
66 |         radio_manager: RadioManager,
   |         ^^^^^^^^^^^^^
...
76 |     fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) {
   |                                            ----- field in this struct

Check warning on line 288 in boards/communication/src/communication.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `xfer` and `buf_select` are never read

warning: fields `xfer` and `buf_select` are never read
   --> boards/communication/src/communication.rs:288:5
    |
287 | pub struct RadioManager {
    |            ------------ fields in this struct
288 |     xfer: Option<RadioTransfer>,
    |     ^^^^
289 |     buf_select: bool,
    |     ^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

Check warning on line 484 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:477:5
    |
477 | /     match logType {
478 | |         // silently handle errors
479 | |         // _SbgDebugLogType_SBG_DEBUG_LOG_TYPE_ERROR => error!("SBG Error"),
480 | |         _SbgDebugLogType_SBG_DEBUG_LOG_TYPE_WARNING => warn!("SBG Warning"),
...   |
483 | |         _ => (),
484 | |     };
    | |_____^ 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 465 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:457:1
    |
457 | / pub unsafe extern "C" fn sbgPlatformDebugLogMsg(
458 | |     _pFileName: *const ::core::ffi::c_char,
459 | |     _pFunctionName: *const ::core::ffi::c_char,
460 | |     _line: u32,
...   |
464 | |     _pFormat: *const ::core::ffi::c_char,
465 | | ) {
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

Check warning on line 419 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:419:23
    |
419 |             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`
    |
419 |             Err(_) => _SbgErrorCode_SBG_READ_ERROR,
    |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 418 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:418:22
    |
418 |             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`
    |
418 |             Ok(_) => _SbgErrorCode_SBG_NO_ERROR,
    |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 407 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:404:5
    |
404 | /     pub unsafe extern "C" fn SbgFlushFunc(
405 | |         pInterface: *mut _SbgInterface,
406 | |         _flags: u32,
407 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

Check warning on line 317 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:313:5
    |
313 | /     pub unsafe extern "C" fn SbgInterfaceWriteFunc(
314 | |         pInterface: *mut _SbgInterface,
315 | |         pBuffer: *const c_void,
316 | |         bytesToWrite: usize,
317 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc

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

See this annotation in the file changed.

@github-actions github-actions / clippy

the loop variable `i` is only used to index `array`

warning: the loop variable `i` is only used to index `array`
   --> libraries/sbg-rs/src/sbg.rs:296:18
    |
296 |         for i in 0..(bytesToRead) {
    |                  ^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
    = note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator
    |
296 |         for <item> in array.iter_mut().take((bytesToRead)) {
    |             ~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Check warning on line 307 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:307:9
    |
307 |         return _SbgErrorCode_SBG_NO_ERROR;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = 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`
    |
307 -         return _SbgErrorCode_SBG_NO_ERROR;
307 +         _SbgErrorCode_SBG_NO_ERROR
    |

Check warning on line 282 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:277:5
    |
277 | /     pub unsafe extern "C" fn SbgInterfaceReadFunc(
278 | |         _pInterface: *mut _SbgInterface,
279 | |         pBuffer: *mut c_void,
280 | |         pBytesRead: *mut usize,
281 | |         bytesToRead: usize,
282 | |     ) -> _SbgErrorCode {
    | |______________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
    = note: `#[warn(clippy::missing_safety_doc)]` on by default

Check warning on line 109 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:109:9
    |
109 |         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