Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clippy to 1.74.0 . Tidy clippy lints #471

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0
toolchain: 1.74.0
target: thumbv7em-none-eabihf
components: clippy
- uses: clechasseur/rs-clippy-check@v3
Expand Down
10 changes: 4 additions & 6 deletions examples/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ fn main() -> ! {
let mut delay = cp.SYST.delay(ccdr.clocks);

loop {
loop {
led.set_high();
delay.delay_ms(500_u16);
led.set_high();
delay.delay_ms(500_u16);

led.set_low();
delay.delay_ms(500_u16);
}
led.set_low();
delay.delay_ms(500_u16);
}
}
14 changes: 6 additions & 8 deletions examples/gpio_with_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ fn main() -> ! {
let mut delay = cp.SYST.delay(ccdr.clocks);

loop {
loop {
led.set_high();
delay.delay_ms(100_u16);
led.set_high();
delay.delay_ms(100_u16);

led.set_low();
delay.delay_ms(100_u16);
led.set_low();
delay.delay_ms(100_u16);

let is_high = led.with_input(|x| x.is_high());
info!("LED pin high? {}", is_high);
}
let is_high = led.with_input(|x| x.is_high());
info!("LED pin high? {}", is_high);
}
}
2 changes: 1 addition & 1 deletion examples/independent_watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn main() -> ! {
let mut watchdog = IndependentWatchdog::new(dp.IWDG2);

// RM0468
#[cfg(all(feature = "rm0468"))]
#[cfg(feature = "rm0468")]
let mut watchdog = IndependentWatchdog::new(dp.IWDG1);

info!("");
Expand Down
2 changes: 1 addition & 1 deletion examples/system_watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn main() -> ! {
let mut watchdog = SystemWindowWatchdog::new(dp.WWDG2, &ccdr);

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

info!("");
Expand Down
6 changes: 2 additions & 4 deletions src/exti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ impl ExtiExt for EXTI {
let line = ev as u8;

match line {
0..=19 | 20 | 21 => {
reg_for_cpu!(self, pr1).read().bits() & (1 << line) != 0
}
0..=21 => reg_for_cpu!(self, pr1).read().bits() & (1 << line) != 0,
49 | 51 => {
reg_for_cpu!(self, pr2).read().bits() & (1 << (line - 32)) != 0
}
Expand All @@ -278,7 +276,7 @@ impl ExtiExt for EXTI {

unsafe {
match line {
0..=19 | 20 | 21 => {
0..=21 => {
reg_for_cpu!(self, pr1).write(|w| w.bits(1 << line));
let _ = reg_for_cpu!(self, pr1).read();
let _ = reg_for_cpu!(self, pr1).read(); // Delay 2 peripheral clocks
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ pub use stm32h7::stm32h743 as stm32;
pub use stm32h7::stm32h743v as stm32;

// Single core with crypto
#[cfg(any(feature = "stm32h753",))]
#[cfg(feature = "stm32h753")]
pub use stm32h7::stm32h753 as stm32;
#[cfg(any(feature = "stm32h753v",))]
#[cfg(feature = "stm32h753v")]
pub use stm32h7::stm32h753v as stm32;

// Dual core
#[cfg(any(feature = "stm32h747cm7",))]
#[cfg(feature = "stm32h747cm7")]
pub use stm32h7::stm32h747cm7 as stm32;
#[cfg(any(feature = "stm32h757cm7",))]
#[cfg(feature = "stm32h757cm7")]
pub use stm32h7::stm32h757cm7 as stm32;
// TODO(rm0399): soundness of PeripheralREC macro in rcc/rec.rs

Expand Down
2 changes: 1 addition & 1 deletion src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub use crate::timer::HalDisabledLpTimer as _stm32h7xx_hal_timer_HalDisabledLpTi
pub use crate::timer::HalEnabledLpTimer as _stm32h7xx_hal_timer_HalEnabledLpTimer;
pub use crate::timer::HalLpTimer as _stm32h7xx_hal_timer_HalLpTimer;
pub use crate::timer::TimerExt as _stm32h7xx_hal_timer_TimerExt;
#[cfg(all(feature = "xspi"))]
#[cfg(feature = "xspi")]
#[cfg_attr(docsrs, doc(cfg(feature = "xspi")))]
pub use crate::xspi::XspiExt as _stm32h7xx_hal_xspi_XspiExt;
pub use fugit::{ExtU32 as _, RateExtU32 as _};