Skip to content

Commit 7b7390d

Browse files
committed
clippy fixes
1 parent d0f38e4 commit 7b7390d

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

src/dma/traits/f4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ dma_map!(
530530
(Stream7<DMA1>:4, pac::FMPI2C1, [MemoryToPeripheral]), //FMPI2C1_TX:DMA_CHANNEL_4
531531
);
532532

533-
#[cfg(any(feature = "gpio-f446",))]
533+
#[cfg(feature = "gpio-f446")]
534534
dma_map!(
535535
(Stream2<DMA1>:2, pac::FMPI2C1, [PeripheralToMemory]), //FMPI2C1_RX
536536
(Stream5<DMA1>:2, pac::FMPI2C1, [MemoryToPeripheral]), //FMPI2C1_TX

src/i2c/hal_02.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ mod blocking {
8181
{
8282
type Error = Error;
8383

84-
fn exec<'a>(
84+
fn exec(
8585
&mut self,
8686
address: u8,
87-
operations: &mut [Operation<'a>],
87+
operations: &mut [Operation<'_>],
8888
) -> Result<(), Self::Error> {
8989
self.transaction_slice_hal_02(address, operations)
9090
}

src/i2s.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ macro_rules! dual_i2s {
428428
dual_i2s!(pac::SPI2, pac::I2S2EXT, DualI2s2, i2s2, i2s_clk);
429429

430430
// add "gpio-f413" feature here when missing I2SEXT in pac wil be fixed.
431-
#[cfg(any(feature = "gpio-f412",))]
431+
#[cfg(feature = "gpio-f412")]
432432
dual_i2s!(pac::SPI2, pac::I2S2EXT, DualI2s2, i2s2, i2s_apb1_clk);
433433

434434
#[cfg(any(
@@ -441,7 +441,7 @@ dual_i2s!(pac::SPI2, pac::I2S2EXT, DualI2s2, i2s2, i2s_apb1_clk);
441441
dual_i2s!(pac::SPI3, pac::I2S3EXT, DualI2s3, i2s3, i2s_clk);
442442

443443
// add "gpio-f413" feature here when missing I2SEXT in pac wil be fixed.
444-
#[cfg(any(feature = "gpio-f412",))]
444+
#[cfg(feature = "gpio-f412")]
445445
dual_i2s!(pac::SPI3, pac::I2S3EXT, DualI2s3, i2s3, i2s_apb1_clk);
446446

447447
// DMA support: reuse existing mappings for SPI

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub mod fmpi2c;
123123
pub mod gpio;
124124
#[cfg(feature = "device-selected")]
125125
pub mod i2c;
126-
#[cfg(all(feature = "device-selected"))]
126+
#[cfg(feature = "device-selected")]
127127
pub mod i2s;
128128
#[cfg(all(feature = "device-selected", feature = "usb_fs", feature = "otg-fs"))]
129129
pub mod otg_fs;

src/timer/monotonic.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ where
189189
} else {
190190
0
191191
};
192-
let i = Self::Instant::from_ticks(u64::from(cnt) + ovf + self.ovf);
193-
i
192+
Self::Instant::from_ticks(u64::from(cnt) + ovf + self.ovf)
194193
}
195194

196195
fn zero() -> Self::Instant {
@@ -210,7 +209,7 @@ where
210209
// how many ticks are left.
211210
let val: TIM::Width = match instant.checked_duration_since(now) {
212211
None => TIM::Width::ONE, // In the past, RTIC will handle this
213-
Some(x) if x.ticks() <= TIM::Width::OVF_VALUE - 1 => {
212+
Some(x) if x.ticks() < TIM::Width::OVF_VALUE => {
214213
TIM::Width::cast_u64(instant.duration_since_epoch().ticks())
215214
} // Will not overflow
216215
Some(_x) => self.tim.read_count().wrapping_add(TIM::Width::FOR_WRAP), // Will overflow

0 commit comments

Comments
 (0)