Skip to content

Merge pull request #498 from stm32-rs/clocks

Sign in for the full log view
GitHub Actions / clippy succeeded Oct 5, 2024 in 0s

clippy

12 warnings

Details

Results

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

Versions

  • rustc 1.81.0 (eeb90cda1 2024-09-04)
  • cargo 1.81.0 (2dbb1af80 2024-08-20)
  • clippy 0.1.81 (eeb90cd 2024-09-04)

Annotations

Check warning on line 165 in src/timer/pwm_input.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/timer/pwm_input.rs:165:45
    |
165 |     let presc = clock / freq.saturating_mul(core::u16::MAX as u32 + 1);
    |                                             ^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
165 |     let presc = clock / freq.saturating_mul(u16::MAX as u32 + 1);
    |                                             ~~~~~~~~

Check warning on line 163 in src/timer/pwm_input.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/timer/pwm_input.rs:163:33
    |
163 |         return (core::u16::MAX, core::u16::MAX);
    |                                 ^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
163 |         return (core::u16::MAX, u16::MAX);
    |                                 ~~~~~~~~

Check warning on line 163 in src/timer/pwm_input.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
   --> src/timer/pwm_input.rs:163:17
    |
163 |         return (core::u16::MAX, core::u16::MAX);
    |                 ^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
163 |         return (u16::MAX, core::u16::MAX);
    |                 ~~~~~~~~

Check warning on line 503 in src/spi.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
   --> src/spi.rs:503:35
    |
503 |         let br = match SPI::clock(&clocks) / freq {
    |                                   ^^^^^^^ help: change this to: `clocks`
    |
    = 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 7 in src/qei.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

importing legacy numeric constants

warning: importing legacy numeric constants
 --> src/qei.rs:7:5
  |
7 | use core::u16;
  |     ^^^^^^^^^
  |
  = help: remove this import
  = note: then `u16::<CONST>` will resolve to the respective associated constant
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants

Check warning on line 38 in src/gpio.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/gpio.rs:38:5
   |
38 | //! used if the [JTAG peripheral has been turned off](#accessing-pa15-pb3-and-pb14).
   |     ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
   |
38 | //!   used if the [JTAG peripheral has been turned off](#accessing-pa15-pb3-and-pb14).
   |     ++

Check warning on line 36 in src/gpio.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/gpio.rs:36:5
   |
36 | //!     mode. Can be used as an input in the `open` configuration
   |     ^^^^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
   |
36 | //!       mode. Can be used as an input in the `open` configuration
   |         ++

Check warning on line 31 in src/gpio.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/gpio.rs:31:5
   |
31 | //!     is connected
   |     ^^^^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
   |
31 | //!       is connected
   |         ++

Check warning on line 29 in src/gpio.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
  --> src/gpio.rs:29:5
   |
29 | //!     is connected
   |     ^^^^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
   = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
   |
29 | //!       is connected
   |         ++

Check warning on line 252 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:252:45
    |
252 |                           Align::Left => u16::max_value(),
    |                                               ^^^^^^^^^^^
...
548 | / adc_hal! {
549 | |     pac::ADC2: (adc2),
550 | | }
    | |_- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
    = note: this warning originates in the macro `adc_hal` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the associated constant instead
    |
252 |                         Align::Left => u16::MAX,
    |                                             ~~~

Check warning on line 252 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:252:45
    |
252 |                           Align::Left => u16::max_value(),
    |                                               ^^^^^^^^^^^
...
543 | / adc_hal! {
544 | |     pac::ADC1: (adc1),
545 | | }
    | |_- in this macro invocation
    |
    = 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
    = note: this warning originates in the macro `adc_hal` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use the associated constant instead
    |
252 |                         Align::Left => u16::MAX,
    |                                             ~~~

Check warning on line 187 in src/rcc/enable.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded sub `cfg` when there is only one condition

warning: unneeded sub `cfg` when there is only one condition
   --> src/rcc/enable.rs:187:7
    |
187 | #[cfg(any(feature = "stm32f103"))] // feature = "stm32f102"
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `feature = "stm32f103"`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
    = note: `#[warn(clippy::non_minimal_cfg)]` on by default