Run rustfmt on rcc.rs #339
clippy
22 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 22 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.0 (aedd173a2 2024-03-17)
- cargo 1.77.0 (3fe68eabf 2024-02-29)
- clippy 0.1.77 (aedd173 2024-03-17)
Annotations
Check warning on line 174 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:174:23
|
174 | .bits(total_height as u16)
| ^^^^^^^^^^^^^^^^^^^ help: try: `total_height`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 172 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:172:23
|
172 | .bits(total_width as u16)
| ^^^^^^^^^^^^^^^^^^ help: try: `total_width`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 168 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:168:23
|
168 | .bits((config.v_sync + config.v_back_porch + config.active_height - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.v_sync + config.v_back_porch + config.active_height - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 166 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:166:23
|
166 | .bits((config.h_sync + config.h_back_porch + config.active_width - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.h_sync + config.h_back_porch + config.active_width - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 162 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:162:23
|
162 | .bits((config.v_sync + config.v_back_porch - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.v_sync + config.v_back_porch - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 160 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:160:23
|
160 | .bits((config.h_sync + config.h_back_porch - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.h_sync + config.h_back_porch - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 156 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:156:23
|
156 | .bits((config.v_sync - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.v_sync - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 154 in src/ltdc.rs
github-actions / clippy
casting to the same type is unnecessary (`u16` -> `u16`)
warning: casting to the same type is unnecessary (`u16` -> `u16`)
--> src/ltdc.rs:154:23
|
154 | .bits((config.h_sync - 1) as u16)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(config.h_sync - 1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 86 in src/ltdc.rs
github-actions / clippy
unneeded late initialization
warning: unneeded late initialization
--> src/ltdc.rs:86:9
|
86 | let base_clk: u32;
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `base_clk` here
|
87 | let base_clk: u32 = match &hse {
| +++++++++++++++++++
help: remove the assignments from the `match` arms
|
88 ~ Some(hse) => hse.freq.raw(),
89 | // If no HSE is provided, we use the HSI clock at 16 MHz
90 ~ None => 16_000_000,
|
help: add a semicolon after the `match` expression
|
91 | };
| +
Check warning on line 317 in src/i2c.rs
github-actions / clippy
casting to the same type is unnecessary (`u8` -> `u8`)
warning: casting to the same type is unnecessary (`u8` -> `u8`)
--> src/i2c.rs:317:25
|
317 | presc = tmp_presc as u8;
| ^^^^^^^^^^^^^^^ help: try: `tmp_presc`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 869 in src/rcc.rs
github-actions / clippy
casting to the same type is unnecessary (`u32` -> `u32`)
warning: casting to the same type is unnecessary (`u32` -> `u32`)
--> src/rcc.rs:869:65
|
869 | let one_over_m = ((1 << Self::FIXED_POINT_LSHIFT) / (m as u32) + 1) >> 1;
| ^^^^^^^^^^ help: try: `m`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 669 in src/rcc.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/rcc.rs:669:36
|
669 | ... (((base_clk as u64 * self.pllsain as u64 * one_over_m as u64)
| ^^^^^^^^^^^^^^^ help: try: `base_clk`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 645 in src/rcc.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/rcc.rs:645:43
|
645 | let pll48clk = (((base_clk as u64 * self.plln as u64 * one_over_m as u64)
| ^^^^^^^^^^^^^^^ help: try: `base_clk`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 629 in src/rcc.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/rcc.rs:629:25
|
629 | sysclk = (((base_clk as u64 * self.plln as u64 * one_over_m as u64)
| ^^^^^^^^^^^^^^^ help: try: `base_clk`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 649 in src/dma.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> src/dma.rs:640:1
|
640 | / impl Default for Interrupts {
641 | | fn default() -> Self {
642 | | Self {
643 | | transfer_complete: false,
... |
648 | | }
649 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
633 + #[derive(Default)]
634 | pub struct Interrupts {
|
Check warning on line 588 in src/dma.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'r
warning: the following explicit lifetimes could be elided: 'r
--> src/dma.rs:588:27
|
588 | fn select<'r>(w: &'r mut dma2::st::cr::W)
| ^^ ^^
589 | -> &'r mut dma2::st::cr::W
| ^^
...
600 | / impl_channel!(
601 | | Channel0, 0;
602 | | Channel1, 1;
603 | | Channel2, 2;
... |
608 | | Channel7, 7;
609 | | );
| |_- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
= note: this warning originates in the macro `impl_channel` (in Nightly builds, run with -Z macro-backtrace for more info)
help: elide the lifetimes
|
588 ~ fn select(w: &mut dma2::st::cr::W)
589 ~ -> &mut dma2::st::cr::W
|
Check warning on line 535 in src/timer.rs
github-actions / clippy
unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/timer.rs:535:31
|
535 | ccr.write(|w| unsafe { w.bits(value) })
| ^^^^^^ unnecessary `unsafe` block
...
729 | / hal! {
730 | | pac::TIM2: [Timer2, u32, c: (CH4), m: tim2,],
731 | | pac::TIM3: [Timer3, u16, c: (CH4), m: tim3,],
732 | | pac::TIM4: [Timer4, u16, c: (CH4), m: tim3,],
... |
744 | | pac::TIM11: [Timer11, u16, c: (CH1),],
745 | | }
| |_- in this macro invocation
|
= note: this warning originates in the macro `with_pwm` which comes from the expansion of the macro `hal` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 535 in src/timer.rs
github-actions / clippy
unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/timer.rs:535:31
|
535 | ccr.write(|w| unsafe { w.bits(value) })
| ^^^^^^ unnecessary `unsafe` block
...
729 | / hal! {
730 | | pac::TIM2: [Timer2, u32, c: (CH4), m: tim2,],
731 | | pac::TIM3: [Timer3, u16, c: (CH4), m: tim3,],
732 | | pac::TIM4: [Timer4, u16, c: (CH4), m: tim3,],
... |
744 | | pac::TIM11: [Timer11, u16, c: (CH1),],
745 | | }
| |_- in this macro invocation
|
= note: `#[warn(unused_unsafe)]` on by default
= note: this warning originates in the macro `with_pwm` which comes from the expansion of the macro `hal` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 209 in src/timer/pwm_input.rs
github-actions / clippy
unneeded sub `cfg` when there is only one condition
warning: unneeded sub `cfg` when there is only one condition
--> src/timer/pwm_input.rs:209:7
|
209 | #[cfg(any(feature = "stm32f411",))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `feature = "stm32f411"`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
Check warning on line 541 in src/serial.rs
github-actions / clippy
unneeded sub `cfg` when there is only one condition
warning: unneeded sub `cfg` when there is only one condition
--> src/serial.rs:541:7
|
541 | #[cfg(any(feature = "device-selected",))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `feature = "device-selected"`
|
= 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
Check warning on line 128 in build.rs
github-actions / clippy
field `0` is never read
warning: field `0` is never read
--> build.rs:128:8
|
128 | Io(io::Error),
| -- ^^^^^^^^^
| |
| field in this variant
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
128 | Io(()),
| ~~
Check warning on line 127 in build.rs
github-actions / clippy
field `0` is never read
warning: field `0` is never read
--> build.rs:127:9
|
127 | Env(env::VarError),
| --- ^^^^^^^^^^^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
127 | Env(()),
| ~~