Skip to content

Merge pull request #179 from urdh/update-pac-crate-to-0.15 #236

Merge pull request #179 from urdh/update-pac-crate-to-0.15

Merge pull request #179 from urdh/update-pac-crate-to-0.15 #236

GitHub Actions / clippy succeeded Aug 24, 2024 in 0s

clippy

14 warnings

Details

Results

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

Versions

  • rustc 1.80.1 (3f5fd8dd4 2024-08-06)
  • cargo 1.80.1 (376290515 2024-07-16)
  • clippy 0.1.80 (3f5fd8d 2024-08-06)

Annotations

Check warning on line 75 in src/can.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
  --> 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

Check warning on line 265 in src/tsc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

constructor `tsc` has the same name as the type

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

Check warning on line 576 in src/rcc.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`
   --> 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 +             }
    |

Check warning on line 468 in src/rcc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

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

Check warning on line 520 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

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,
    |                           ~~~

Check warning on line 519 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

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),
    |                                                    ~~~

Check warning on line 517 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric method

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,
    |                                    ~~~

Check warning on line 411 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

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

Check warning on line 319 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

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

Check warning on line 250 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `default` to create a unit struct

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

Check warning on line 175 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `default` can be confused for the standard trait method `std::default::Default::default`

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

Check warning on line 145 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `default` can be confused for the standard trait method `std::default::Default::default`

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

Check warning on line 100 in src/adc.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `default` can be confused for the standard trait method `std::default::Default::default`

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

Check warning on line 204 in src/timers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unnecessary `unsafe` block

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)