Skip to content

Merge pull request #181 from dimpolo/bump-bxcan #238

Merge pull request #181 from dimpolo/bump-bxcan

Merge pull request #181 from dimpolo/bump-bxcan #238

Triggered via push September 20, 2024 15:04
Status Success
Total duration 32s
Artifacts

clippy.yml

on: push
clippy_check
22s
clippy_check
Fit to window
Zoom out
Zoom in

Annotations

20 warnings
unsafe function's docs are missing a `# Safety` section: src/can.rs#L75
warning: unsafe function's docs are missing a `# Safety` section --> src/can.rs:75:5 | 75 | pub unsafe fn peripheral(&mut self) -> &mut CAN { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = 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
constructor `tsc` has the same name as the type: src/tsc.rs#L223
warning: constructor `tsc` has the same name as the type --> src/tsc.rs:223:5 | 223 | / pub fn tsc(tsc: TSC, rcc: &mut Rcc, cfg: Option<Config>) -> Self { 224 | | // Enable the peripheral clock 225 | | rcc.regs.ahbenr.modify(|_, w| w.tscen().set_bit()); 226 | | rcc.regs.ahbrstr.modify(|_, w| w.tscrst().set_bit()); ... | 264 | | Tsc { tsc } 265 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors = note: `#[warn(clippy::self_named_constructors)]` on by default
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/rcc.rs#L565
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/rcc.rs:565:13 | 565 | / match self.crs { 566 | | Some(crs) => { 567 | | self.rcc.apb1enr.modify(|_, w| w.crsen().set_bit()); ... | 575 | | _ => {} 576 | | } | |_____________^ | = 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 | 565 ~ if let Some(crs) = self.crs { 566 + self.rcc.apb1enr.modify(|_, w| w.crsen().set_bit()); 567 + 568 + // Initialize clock recovery 569 + // Set autotrim enabled. 570 + crs.cr.modify(|_, w| w.autotrimen().set_bit()); 571 + // Enable CR 572 + crs.cr.modify(|_, w| w.cen().set_bit()); 573 + } |
clamp-like pattern without using clamp function: src/rcc.rs#L468
warning: clamp-like pattern without using clamp function --> src/rcc.rs:468:26 | 468 | let pllmul = core::cmp::min(core::cmp::max(pllmul, 2), 16); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `pllmul.clamp(2, 16)` | = note: clamp will panic if max < min = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp = note: `#[warn(clippy::manual_clamp)]` on by default
usage of a legacy numeric method: src/adc.rs#L520
warning: usage of a legacy numeric method --> src/adc.rs:520:27 | 520 | _ => u16::max_value(), | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants help: use the associated constant instead | 520 | _ => u16::MAX, | ~~~
usage of a legacy numeric method: src/adc.rs#L519
warning: usage of a legacy numeric method --> src/adc.rs:519:52 | 519 | AdcPrecision::B_6 => u16::from(u8::max_value()), | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants help: use the associated constant instead | 519 | AdcPrecision::B_6 => u16::from(u8::MAX), | ~~~
usage of a legacy numeric method: src/adc.rs#L517
warning: usage of a legacy numeric method --> src/adc.rs:517:36 | 517 | AdcAlign::Left => u16::max_value(), | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants = note: `#[warn(clippy::legacy_numeric_constants)]` on by default help: use the associated constant instead | 517 | AdcAlign::Left => u16::MAX, | ~~~
use of `default` to create a unit struct: src/adc.rs#L411
warning: use of `default` to create a unit struct --> src/adc.rs:411:13 | 411 | VBat::default() | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
use of `default` to create a unit struct: src/adc.rs#L319
warning: use of `default` to create a unit struct --> src/adc.rs:319:13 | 319 | VRef::default() | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
use of `default` to create a unit struct: src/adc.rs#L250
warning: use of `default` to create a unit struct --> src/adc.rs:250:14 | 250 | VTemp::default() | ^^^^^^^^^^^ help: remove this call to `default` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default
method `default` can be confused for the standard trait method `std::default::Default::default`: src/adc.rs#L173
warning: method `default` can be confused for the standard trait method `std::default::Default::default` --> src/adc.rs:173:5 | 173 | / pub fn default() -> Self { 174 | | AdcPrecision::B_12 175 | | } | |_____^ | = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
method `default` can be confused for the standard trait method `std::default::Default::default`: src/adc.rs#L143
warning: method `default` can be confused for the standard trait method `std::default::Default::default` --> src/adc.rs:143:5 | 143 | / pub fn default() -> Self { 144 | | AdcAlign::Right 145 | | } | |_____^ | = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
method `default` can be confused for the standard trait method `std::default::Default::default`: src/adc.rs#L98
warning: method `default` can be confused for the standard trait method `std::default::Default::default` --> src/adc.rs:98:5 | 98 | / pub fn default() -> Self { 99 | | AdcSampleTime::T_239 100 | | } | |_____^ | = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait = note: `#[warn(clippy::should_implement_trait)]` on by default
unnecessary `unsafe` block: src/timers.rs#L204
warning: unnecessary `unsafe` block --> src/timers.rs:204:44 | 204 | self.tim.arr.write(|w| unsafe { w.bits(cast::u32(arr)) }); | ^^^^^^ unnecessary `unsafe` block ... 248 | / timers! { 249 | | TIM2: (tim2, tim2en, tim2rst, apb1enr, apb1rstr), 250 | | } | |_- in this macro invocation | = note: `#[warn(unused_unsafe)]` on by default = note: this warning originates in the macro `timers` (in Nightly builds, run with -Z macro-backtrace for more info)
clippy_check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
clippy_check
The following actions use a deprecated Node.js version and will be forced to run on node20: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
clippy_check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/