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

Fix several clippy warnings in current stable / beta #641

Merged
merged 1 commit into from
Nov 22, 2024
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
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