Skip to content

Commit cd7c125

Browse files
committed
Update clippy to 1.74.0 . Tidy clippy lints
1 parent c2a4c0e commit cd7c125

File tree

8 files changed

+20
-26
lines changed

8 files changed

+20
-26
lines changed

.github/workflows/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: dtolnay/rust-toolchain@master
1414
with:
15-
toolchain: 1.66.0
15+
toolchain: 1.74.0
1616
target: thumbv7em-none-eabihf
1717
components: clippy
1818
- uses: clechasseur/rs-clippy-check@v3

examples/blinky.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ fn main() -> ! {
4141
let mut delay = cp.SYST.delay(ccdr.clocks);
4242

4343
loop {
44-
loop {
45-
led.set_high();
46-
delay.delay_ms(500_u16);
44+
led.set_high();
45+
delay.delay_ms(500_u16);
4746

48-
led.set_low();
49-
delay.delay_ms(500_u16);
50-
}
47+
led.set_low();
48+
delay.delay_ms(500_u16);
5149
}
5250
}

examples/gpio_with_input.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ fn main() -> ! {
4444
let mut delay = cp.SYST.delay(ccdr.clocks);
4545

4646
loop {
47-
loop {
48-
led.set_high();
49-
delay.delay_ms(100_u16);
47+
led.set_high();
48+
delay.delay_ms(100_u16);
5049

51-
led.set_low();
52-
delay.delay_ms(100_u16);
50+
led.set_low();
51+
delay.delay_ms(100_u16);
5352

54-
let is_high = led.with_input(|x| x.is_high());
55-
info!("LED pin high? {}", is_high);
56-
}
53+
let is_high = led.with_input(|x| x.is_high());
54+
info!("LED pin high? {}", is_high);
5755
}
5856
}

examples/independent_watchdog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn main() -> ! {
3636
let mut watchdog = IndependentWatchdog::new(dp.IWDG2);
3737

3838
// RM0468
39-
#[cfg(all(feature = "rm0468"))]
39+
#[cfg(feature = "rm0468")]
4040
let mut watchdog = IndependentWatchdog::new(dp.IWDG1);
4141

4242
info!("");

examples/system_watchdog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() -> ! {
3434
let mut watchdog = SystemWindowWatchdog::new(dp.WWDG2, &ccdr);
3535

3636
// RM0468
37-
#[cfg(all(feature = "rm0468"))]
37+
#[cfg(feature = "rm0468")]
3838
let mut watchdog = SystemWindowWatchdog::new(dp.WWDG1, &ccdr);
3939

4040
info!("");

src/exti.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ impl ExtiExt for EXTI {
257257
let line = ev as u8;
258258

259259
match line {
260-
0..=19 | 20 | 21 => {
261-
reg_for_cpu!(self, pr1).read().bits() & (1 << line) != 0
262-
}
260+
0..=21 => reg_for_cpu!(self, pr1).read().bits() & (1 << line) != 0,
263261
49 | 51 => {
264262
reg_for_cpu!(self, pr2).read().bits() & (1 << (line - 32)) != 0
265263
}
@@ -278,7 +276,7 @@ impl ExtiExt for EXTI {
278276

279277
unsafe {
280278
match line {
281-
0..=19 | 20 | 21 => {
279+
0..=21 => {
282280
reg_for_cpu!(self, pr1).write(|w| w.bits(1 << line));
283281
let _ = reg_for_cpu!(self, pr1).read();
284282
let _ = reg_for_cpu!(self, pr1).read(); // Delay 2 peripheral clocks

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ pub use stm32h7::stm32h743 as stm32;
102102
pub use stm32h7::stm32h743v as stm32;
103103

104104
// Single core with crypto
105-
#[cfg(any(feature = "stm32h753",))]
105+
#[cfg(feature = "stm32h753")]
106106
pub use stm32h7::stm32h753 as stm32;
107-
#[cfg(any(feature = "stm32h753v",))]
107+
#[cfg(feature = "stm32h753v")]
108108
pub use stm32h7::stm32h753v as stm32;
109109

110110
// Dual core
111-
#[cfg(any(feature = "stm32h747cm7",))]
111+
#[cfg(feature = "stm32h747cm7")]
112112
pub use stm32h7::stm32h747cm7 as stm32;
113-
#[cfg(any(feature = "stm32h757cm7",))]
113+
#[cfg(feature = "stm32h757cm7")]
114114
pub use stm32h7::stm32h757cm7 as stm32;
115115
// TODO(rm0399): soundness of PeripheralREC macro in rcc/rec.rs
116116

src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub use crate::timer::HalDisabledLpTimer as _stm32h7xx_hal_timer_HalDisabledLpTi
3939
pub use crate::timer::HalEnabledLpTimer as _stm32h7xx_hal_timer_HalEnabledLpTimer;
4040
pub use crate::timer::HalLpTimer as _stm32h7xx_hal_timer_HalLpTimer;
4141
pub use crate::timer::TimerExt as _stm32h7xx_hal_timer_TimerExt;
42-
#[cfg(all(feature = "xspi"))]
42+
#[cfg(feature = "xspi")]
4343
#[cfg_attr(docsrs, doc(cfg(feature = "xspi")))]
4444
pub use crate::xspi::XspiExt as _stm32h7xx_hal_xspi_XspiExt;
4545
pub use fugit::{ExtU32 as _, RateExtU32 as _};

0 commit comments

Comments
 (0)