Skip to content

Commit

Permalink
Fix several clippy warnings in current stable / beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jannic committed Nov 22, 2024
1 parent 56a4c6a commit 9a1921a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions embedded-hal-bus/src/i2c/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<T: Error> Error for AtomicError<T> {
}
}

unsafe impl<'a, T> Send for AtomicDevice<'a, T> {}
unsafe impl<T> Send for AtomicDevice<'_, T> {}

impl<'a, T> AtomicDevice<'a, T>
where
Expand Down Expand Up @@ -137,14 +137,14 @@ where
}
}

impl<'a, T> ErrorType for AtomicDevice<'a, T>
impl<T> ErrorType for AtomicDevice<'_, T>
where
T: I2c,
{
type Error = AtomicError<T::Error>;
}

impl<'a, T> I2c for AtomicDevice<'a, T>
impl<T> I2c for AtomicDevice<'_, T>
where
T: I2c,
{
Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/i2c/critical_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ impl<'a, T> CriticalSectionDevice<'a, T> {
}
}

impl<'a, T> ErrorType for CriticalSectionDevice<'a, T>
impl<T> ErrorType for CriticalSectionDevice<'_, T>
where
T: I2c,
{
type Error = T::Error;
}

impl<'a, T> I2c for CriticalSectionDevice<'a, T>
impl<T> I2c for CriticalSectionDevice<'_, T>
where
T: I2c,
{
Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/i2c/refcell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ impl<'a, T> RefCellDevice<'a, T> {
}
}

impl<'a, T> ErrorType for RefCellDevice<'a, T>
impl<T> ErrorType for RefCellDevice<'_, T>
where
T: I2c,
{
type Error = T::Error;
}

impl<'a, T> I2c for RefCellDevice<'a, T>
impl<T> I2c for RefCellDevice<'_, T>
where
T: I2c,
{
Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/spi/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ impl<T: Error> Error for AtomicError<T> {
}
}

impl<'a, BUS, CS, D> ErrorType for AtomicDevice<'a, BUS, CS, D>
impl<BUS, CS, D> ErrorType for AtomicDevice<'_, BUS, CS, D>
where
BUS: ErrorType,
CS: OutputPin,
{
type Error = AtomicError<DeviceError<BUS::Error, CS::Error>>;
}

impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for AtomicDevice<'a, BUS, CS, D>
impl<Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for AtomicDevice<'_, BUS, CS, D>
where
BUS: SpiBus<Word>,
CS: OutputPin,
Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/spi/critical_section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ impl<'a, BUS, CS> CriticalSectionDevice<'a, BUS, CS, super::NoDelay> {
}
}

impl<'a, BUS, CS, D> ErrorType for CriticalSectionDevice<'a, BUS, CS, D>
impl<BUS, CS, D> ErrorType for CriticalSectionDevice<'_, BUS, CS, D>
where
BUS: ErrorType,
CS: OutputPin,
{
type Error = DeviceError<BUS::Error, CS::Error>;
}

impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for CriticalSectionDevice<'a, BUS, CS, D>
impl<Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for CriticalSectionDevice<'_, BUS, CS, D>
where
BUS: SpiBus<Word>,
CS: OutputPin,
Expand Down
4 changes: 2 additions & 2 deletions embedded-hal-bus/src/spi/refcell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ impl<'a, BUS, CS> RefCellDevice<'a, BUS, CS, super::NoDelay> {
}
}

impl<'a, BUS, CS, D> ErrorType for RefCellDevice<'a, BUS, CS, D>
impl<BUS, CS, D> ErrorType for RefCellDevice<'_, BUS, CS, D>
where
BUS: ErrorType,
CS: OutputPin,
{
type Error = DeviceError<BUS::Error, CS::Error>;
}

impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for RefCellDevice<'a, BUS, CS, D>
impl<Word: Copy + 'static, BUS, CS, D> SpiDevice<Word> for RefCellDevice<'_, BUS, CS, D>
where
BUS: SpiBus<Word>,
CS: OutputPin,
Expand Down
1 change: 0 additions & 1 deletion embedded-hal-nb/src/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ impl<T: Write<Word> + ?Sized, Word: Copy> Write<Word> for &mut T {
/// Implementation of `core::fmt::Write` for the HAL's `serial::Write`.
///
/// TODO write example of usage

impl<Word, Error: self::Error> core::fmt::Write for dyn Write<Word, Error = Error> + '_
where
Word: Copy + From<u8>,
Expand Down

0 comments on commit 9a1921a

Please sign in to comment.