From 9a1921ab8703dafc0994d8db03ca886c006533cc Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Fri, 22 Nov 2024 19:01:07 +0000 Subject: [PATCH] Fix several clippy warnings in current stable / beta --- embedded-hal-bus/src/i2c/atomic.rs | 6 +++--- embedded-hal-bus/src/i2c/critical_section.rs | 4 ++-- embedded-hal-bus/src/i2c/refcell.rs | 4 ++-- embedded-hal-bus/src/spi/atomic.rs | 4 ++-- embedded-hal-bus/src/spi/critical_section.rs | 4 ++-- embedded-hal-bus/src/spi/refcell.rs | 4 ++-- embedded-hal-nb/src/serial.rs | 1 - 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/embedded-hal-bus/src/i2c/atomic.rs b/embedded-hal-bus/src/i2c/atomic.rs index 793e827b1..8443e4618 100644 --- a/embedded-hal-bus/src/i2c/atomic.rs +++ b/embedded-hal-bus/src/i2c/atomic.rs @@ -101,7 +101,7 @@ impl Error for AtomicError { } } -unsafe impl<'a, T> Send for AtomicDevice<'a, T> {} +unsafe impl Send for AtomicDevice<'_, T> {} impl<'a, T> AtomicDevice<'a, T> where @@ -137,14 +137,14 @@ where } } -impl<'a, T> ErrorType for AtomicDevice<'a, T> +impl ErrorType for AtomicDevice<'_, T> where T: I2c, { type Error = AtomicError; } -impl<'a, T> I2c for AtomicDevice<'a, T> +impl I2c for AtomicDevice<'_, T> where T: I2c, { diff --git a/embedded-hal-bus/src/i2c/critical_section.rs b/embedded-hal-bus/src/i2c/critical_section.rs index 6830f284f..be0bfb8ce 100644 --- a/embedded-hal-bus/src/i2c/critical_section.rs +++ b/embedded-hal-bus/src/i2c/critical_section.rs @@ -21,14 +21,14 @@ impl<'a, T> CriticalSectionDevice<'a, T> { } } -impl<'a, T> ErrorType for CriticalSectionDevice<'a, T> +impl ErrorType for CriticalSectionDevice<'_, T> where T: I2c, { type Error = T::Error; } -impl<'a, T> I2c for CriticalSectionDevice<'a, T> +impl I2c for CriticalSectionDevice<'_, T> where T: I2c, { diff --git a/embedded-hal-bus/src/i2c/refcell.rs b/embedded-hal-bus/src/i2c/refcell.rs index 1519a751b..445b6b020 100644 --- a/embedded-hal-bus/src/i2c/refcell.rs +++ b/embedded-hal-bus/src/i2c/refcell.rs @@ -75,14 +75,14 @@ impl<'a, T> RefCellDevice<'a, T> { } } -impl<'a, T> ErrorType for RefCellDevice<'a, T> +impl ErrorType for RefCellDevice<'_, T> where T: I2c, { type Error = T::Error; } -impl<'a, T> I2c for RefCellDevice<'a, T> +impl I2c for RefCellDevice<'_, T> where T: I2c, { diff --git a/embedded-hal-bus/src/spi/atomic.rs b/embedded-hal-bus/src/spi/atomic.rs index 7d18e28c5..10dc043b7 100644 --- a/embedded-hal-bus/src/spi/atomic.rs +++ b/embedded-hal-bus/src/spi/atomic.rs @@ -106,7 +106,7 @@ impl Error for AtomicError { } } -impl<'a, BUS, CS, D> ErrorType for AtomicDevice<'a, BUS, CS, D> +impl ErrorType for AtomicDevice<'_, BUS, CS, D> where BUS: ErrorType, CS: OutputPin, @@ -114,7 +114,7 @@ where type Error = AtomicError>; } -impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice for AtomicDevice<'a, BUS, CS, D> +impl SpiDevice for AtomicDevice<'_, BUS, CS, D> where BUS: SpiBus, CS: OutputPin, diff --git a/embedded-hal-bus/src/spi/critical_section.rs b/embedded-hal-bus/src/spi/critical_section.rs index 4c3a46eb2..3ab2d29cc 100644 --- a/embedded-hal-bus/src/spi/critical_section.rs +++ b/embedded-hal-bus/src/spi/critical_section.rs @@ -72,7 +72,7 @@ impl<'a, BUS, CS> CriticalSectionDevice<'a, BUS, CS, super::NoDelay> { } } -impl<'a, BUS, CS, D> ErrorType for CriticalSectionDevice<'a, BUS, CS, D> +impl ErrorType for CriticalSectionDevice<'_, BUS, CS, D> where BUS: ErrorType, CS: OutputPin, @@ -80,7 +80,7 @@ where type Error = DeviceError; } -impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice for CriticalSectionDevice<'a, BUS, CS, D> +impl SpiDevice for CriticalSectionDevice<'_, BUS, CS, D> where BUS: SpiBus, CS: OutputPin, diff --git a/embedded-hal-bus/src/spi/refcell.rs b/embedded-hal-bus/src/spi/refcell.rs index 35bea03a2..9f0374e34 100644 --- a/embedded-hal-bus/src/spi/refcell.rs +++ b/embedded-hal-bus/src/spi/refcell.rs @@ -69,7 +69,7 @@ impl<'a, BUS, CS> RefCellDevice<'a, BUS, CS, super::NoDelay> { } } -impl<'a, BUS, CS, D> ErrorType for RefCellDevice<'a, BUS, CS, D> +impl ErrorType for RefCellDevice<'_, BUS, CS, D> where BUS: ErrorType, CS: OutputPin, @@ -77,7 +77,7 @@ where type Error = DeviceError; } -impl<'a, Word: Copy + 'static, BUS, CS, D> SpiDevice for RefCellDevice<'a, BUS, CS, D> +impl SpiDevice for RefCellDevice<'_, BUS, CS, D> where BUS: SpiBus, CS: OutputPin, diff --git a/embedded-hal-nb/src/serial.rs b/embedded-hal-nb/src/serial.rs index 2b0d504ef..981422702 100644 --- a/embedded-hal-nb/src/serial.rs +++ b/embedded-hal-nb/src/serial.rs @@ -118,7 +118,6 @@ impl + ?Sized, Word: Copy> Write for &mut T { /// Implementation of `core::fmt::Write` for the HAL's `serial::Write`. /// /// TODO write example of usage - impl core::fmt::Write for dyn Write + '_ where Word: Copy + From,