diff --git a/src/guard.rs b/src/guard.rs index 88f2754..597ab50 100644 --- a/src/guard.rs +++ b/src/guard.rs @@ -31,7 +31,7 @@ impl<'a, B: Write + Read> LockFreeGuard<'a, B> { } } -impl<'a, B> RefGuard for LockFreeGuard<'a, B> +impl RefGuard for LockFreeGuard<'_, B> where B: Write + Read, { diff --git a/src/pin_refreshable.rs b/src/pin_refreshable.rs index 8f18ecf..4617609 100644 --- a/src/pin_refreshable.rs +++ b/src/pin_refreshable.rs @@ -56,7 +56,7 @@ where } } -impl<'a, B, R> RefreshableInputPin for Pin<'a, B, R, Input, RefreshMode> +impl RefreshableInputPin for Pin<'_, B, R, Input, RefreshMode> where B: Write + Read, R: RefGuard, @@ -75,7 +75,7 @@ where } } -impl<'a, B, R> RefreshableOutputPin for Pin<'a, B, R, Output, RefreshMode> +impl RefreshableOutputPin for Pin<'_, B, R, Output, RefreshMode> where B: Write + Read, R: RefGuard, @@ -94,7 +94,7 @@ where } } -impl<'a, B, R> Pin<'a, B, R, Output, RefreshMode> +impl Pin<'_, B, R, Output, RefreshMode> where B: Write + Read, R: RefGuard, @@ -111,7 +111,7 @@ where } } -impl<'a, B, R> InputPin for Pin<'a, B, R, Input, RefreshMode> +impl InputPin for Pin<'_, B, R, Input, RefreshMode> where B: Write + Read, R: RefGuard, @@ -133,7 +133,7 @@ where } } -impl<'a, B, R> OutputPin for Pin<'a, B, R, Output, RefreshMode> +impl OutputPin for Pin<'_, B, R, Output, RefreshMode> where B: Read + Write, R: RefGuard, @@ -157,7 +157,7 @@ where } } -impl<'a, B, R> StatefulOutputPin for Pin<'a, B, R, Output, RefreshMode> +impl StatefulOutputPin for Pin<'_, B, R, Output, RefreshMode> where B: Write + Read, R: RefGuard, @@ -171,7 +171,7 @@ where } } -impl<'a, B, R> toggleable::Default for Pin<'a, B, R, Output, RefreshMode> +impl toggleable::Default for Pin<'_, B, R, Output, RefreshMode> where B: Write + Read, R: RefGuard, diff --git a/src/pin_regular.rs b/src/pin_regular.rs index 35db652..cc5b19f 100644 --- a/src/pin_regular.rs +++ b/src/pin_regular.rs @@ -22,7 +22,7 @@ where } } -impl<'a, B, R> InputPin for Pin<'a, B, R, Input, RegularAccessMode> +impl InputPin for Pin<'_, B, R, Input, RegularAccessMode> where B: Write + Read, R: RefGuard, @@ -47,7 +47,7 @@ where } } -impl<'a, B, R> OutputPin for Pin<'a, B, R, Output, RegularAccessMode> +impl OutputPin for Pin<'_, B, R, Output, RegularAccessMode> where B: Read + Write, R: RefGuard, @@ -74,7 +74,7 @@ where } } -impl<'a, B, R> StatefulOutputPin for Pin<'a, B, R, Output, RegularAccessMode> +impl StatefulOutputPin for Pin<'_, B, R, Output, RegularAccessMode> where B: Write + Read, R: RefGuard, @@ -90,7 +90,7 @@ where } } -impl<'a, B, R> toggleable::Default for Pin<'a, B, R, Output, RegularAccessMode> +impl toggleable::Default for Pin<'_, B, R, Output, RegularAccessMode> where B: Write + Read, R: RefGuard, diff --git a/src/pins.rs b/src/pins.rs index fd6affb..3170e8e 100644 --- a/src/pins.rs +++ b/src/pins.rs @@ -4,10 +4,10 @@ //! //! Due to the I2C overhead, this module offers two options for state management: //! * [Regular access mode](RegularAccessMode): The state is synchronously updated when calling -//! state functions like `is_high()`, causing 1:1 I2C operations for each individual call. +//! state functions like `is_high()`, causing 1:1 I2C operations for each individual call. //! * [Refresh access mode](RefreshMode): Register states are internally cached. Functions like -//! `is_high()` are just using the cached state. The state is updated explicitly, but for all pins at once. -//! In the best case, the I2C overhead is reduced to one eighth. See [below examples](#refreshable-access-mode) for more details. +//! `is_high()` are just using the cached state. The state is updated explicitly, but for all pins at once. +//! In the best case, the I2C overhead is reduced to one eighth. See [below examples](#refreshable-access-mode) for more details. //! //! ## Setup //! Individual pins can be fetched using [PCA9539](crate::expander::PCA9539) instance. @@ -199,7 +199,7 @@ impl> Pins { /// Currently there are two modes supported: /// * Regular: State of the pin is synchronously fetched from I2C bus when calling functions like `is_high()` /// * Refreshable: State of all pins is refreshed explicitly and functions like `is_high()` are working on a cached state. -/// This reducing the I2C overhead +/// This reducing the I2C overhead pub trait AccessMode {} /// State of the pin is synchronously fetched from I2C bus @@ -238,7 +238,7 @@ where pub(crate) access_mode: PhantomData, } -impl<'a, B, R, A> Pin<'a, B, R, Input, A> +impl Pin<'_, B, R, Input, A> where B: Write + Read, R: RefGuard, @@ -256,7 +256,7 @@ where } } -impl<'a, B, R, A> Pin<'a, B, R, Output, A> +impl Pin<'_, B, R, Output, A> where B: Write + Read, R: RefGuard, @@ -273,7 +273,7 @@ where } } -impl<'a, B, M, R, A> Pin<'a, B, R, M, A> +impl Pin<'_, B, R, M, A> where B: Write + Read, R: RefGuard,