This commit is contained in:
ivmarkov 2024-10-04 07:51:51 +00:00
parent b01224cdfb
commit aabc000d5e
13 changed files with 94 additions and 94 deletions

View File

@ -150,8 +150,8 @@ mod oneshot_legacy {
}
}
impl<'d, const A: adc_atten_t, T: ADCPin> embedded_hal_0_2::adc::Channel<T::Adc>
for AdcChannelDriver<'d, A, T>
impl<const A: adc_atten_t, T: ADCPin> embedded_hal_0_2::adc::Channel<T::Adc>
for AdcChannelDriver<'_, A, T>
{
type ID = (adc_channel_t, adc_atten_t);
@ -173,7 +173,7 @@ mod oneshot_legacy {
>,
}
unsafe impl<'d, ADC: Adc> Send for AdcDriver<'d, ADC> {}
unsafe impl<ADC: Adc> Send for AdcDriver<'_, ADC> {}
impl<'d, ADC: Adc> AdcDriver<'d, ADC> {
#[cfg(all(
@ -404,9 +404,9 @@ mod oneshot_legacy {
}
}
impl<'d, 'c, const A: adc_atten_t, T>
impl<'c, const A: adc_atten_t, T>
embedded_hal_0_2::adc::OneShot<T::Adc, u16, AdcChannelDriver<'c, A, T>>
for AdcDriver<'d, T::Adc>
for AdcDriver<'_, T::Adc>
where
T: ADCPin,
{
@ -797,7 +797,7 @@ pub mod oneshot {
}
}
impl<'d, ADC: Adc> Drop for AdcDriver<'d, ADC> {
impl<ADC: Adc> Drop for AdcDriver<'_, ADC> {
fn drop(&mut self) {
unsafe { esp!(adc_oneshot_del_unit(self.handle)) }.unwrap();
}
@ -816,8 +816,8 @@ pub mod oneshot {
}
}
unsafe impl<'d, ADC: Adc> Send for AdcDriver<'d, ADC> {}
unsafe impl<'d, ADC: Adc> Sync for AdcDriver<'d, ADC> {}
unsafe impl<ADC: Adc> Send for AdcDriver<'_, ADC> {}
unsafe impl<ADC: Adc> Sync for AdcDriver<'_, ADC> {}
}
/// Continuous ADC module
@ -923,10 +923,10 @@ pub mod continuous {
fn iter(&self) -> Self::Iterator<'_>;
}
impl<'d, P> AdcChannels for P
impl<P> AdcChannels for P
where
P: Peripheral,
P::P: ADCPin + 'd,
P::P: ADCPin,
{
type Adc = <<P as Peripheral>::P as ADCPin>::Adc;
@ -940,9 +940,9 @@ pub mod continuous {
}
}
impl<'d, const A: adc_atten_t, C> AdcChannels for Attenuated<A, C>
impl<const A: adc_atten_t, C> AdcChannels for Attenuated<A, C>
where
C: AdcChannels + 'd,
C: AdcChannels,
{
type Adc = C::Adc;
@ -1417,7 +1417,7 @@ pub mod continuous {
}
}
impl<'d> Drop for AdcDriver<'d> {
impl Drop for AdcDriver<'_> {
fn drop(&mut self) {
let _ = self.stop();
@ -1440,13 +1440,13 @@ pub mod continuous {
}
}
unsafe impl<'d> Send for AdcDriver<'d> {}
unsafe impl Send for AdcDriver<'_> {}
impl<'d> embedded_io::ErrorType for AdcDriver<'d> {
impl embedded_io::ErrorType for AdcDriver<'_> {
type Error = EspIOError;
}
impl<'d> embedded_io::Read for AdcDriver<'d> {
impl embedded_io::Read for AdcDriver<'_> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
self.read_bytes(buf, delay::BLOCK).map_err(EspIOError)
}

View File

@ -463,16 +463,16 @@ impl<'d> CanDriver<'d> {
}
}
impl<'d> Drop for CanDriver<'d> {
impl Drop for CanDriver<'_> {
fn drop(&mut self) {
let _ = self.stop();
esp!(unsafe { twai_driver_uninstall() }).unwrap();
}
}
unsafe impl<'d> Send for CanDriver<'d> {}
unsafe impl Send for CanDriver<'_> {}
impl<'d> embedded_hal_0_2::blocking::can::Can for CanDriver<'d> {
impl embedded_hal_0_2::blocking::can::Can for CanDriver<'_> {
type Frame = Frame;
type Error = Can02Error;
@ -485,7 +485,7 @@ impl<'d> embedded_hal_0_2::blocking::can::Can for CanDriver<'d> {
}
}
impl<'d> embedded_can::blocking::Can for CanDriver<'d> {
impl embedded_can::blocking::Can for CanDriver<'_> {
type Frame = Frame;
type Error = CanError;
@ -498,7 +498,7 @@ impl<'d> embedded_can::blocking::Can for CanDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::can::nb::Can for CanDriver<'d> {
impl embedded_hal_0_2::can::nb::Can for CanDriver<'_> {
type Frame = Frame;
type Error = Can02Error;
@ -520,7 +520,7 @@ impl<'d> embedded_hal_0_2::can::nb::Can for CanDriver<'d> {
}
}
impl<'d> embedded_can::nb::Can for CanDriver<'d> {
impl embedded_can::nb::Can for CanDriver<'_> {
type Frame = Frame;
type Error = CanError;

View File

@ -1224,15 +1224,15 @@ impl<T: Pin, MODE: InputMode> PinDriver<'_, T, MODE> {
}
}
impl<'d, T: Pin, MODE> Drop for PinDriver<'d, T, MODE> {
impl<T: Pin, MODE> Drop for PinDriver<'_, T, MODE> {
fn drop(&mut self) {
gpio_reset_without_pull(self.pin.pin()).unwrap();
}
}
unsafe impl<'d, T: Pin, MODE> Send for PinDriver<'d, T, MODE> {}
unsafe impl<T: Pin, MODE> Send for PinDriver<'_, T, MODE> {}
impl<'d, T: Pin, MODE> embedded_hal_0_2::digital::v2::InputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal_0_2::digital::v2::InputPin for PinDriver<'_, T, MODE>
where
MODE: InputMode,
{
@ -1258,11 +1258,11 @@ fn to_gpio_err(err: EspError) -> GpioError {
GpioError::other(err)
}
impl<'d, T: Pin, MODE> embedded_hal::digital::ErrorType for PinDriver<'d, T, MODE> {
impl<T: Pin, MODE> embedded_hal::digital::ErrorType for PinDriver<'_, T, MODE> {
type Error = GpioError;
}
impl<'d, T: Pin, MODE> embedded_hal::digital::InputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal::digital::InputPin for PinDriver<'_, T, MODE>
where
MODE: InputMode,
{
@ -1275,7 +1275,7 @@ where
}
}
impl<'d, T: Pin, MODE> embedded_hal::digital::InputPin for &PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal::digital::InputPin for &PinDriver<'_, T, MODE>
where
MODE: InputMode,
{
@ -1288,7 +1288,7 @@ where
}
}
impl<'d, T: Pin, MODE> embedded_hal_0_2::digital::v2::OutputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal_0_2::digital::v2::OutputPin for PinDriver<'_, T, MODE>
where
MODE: OutputMode,
{
@ -1303,7 +1303,7 @@ where
}
}
impl<'d, T: Pin, MODE> embedded_hal::digital::OutputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal::digital::OutputPin for PinDriver<'_, T, MODE>
where
MODE: OutputMode,
{
@ -1316,7 +1316,7 @@ where
}
}
impl<'d, T: Pin, MODE> embedded_hal::digital::StatefulOutputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal::digital::StatefulOutputPin for PinDriver<'_, T, MODE>
where
MODE: OutputMode,
{
@ -1343,7 +1343,7 @@ where
// }
// }
impl<'d, T: Pin, MODE> embedded_hal_0_2::digital::v2::StatefulOutputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal_0_2::digital::v2::StatefulOutputPin for PinDriver<'_, T, MODE>
where
MODE: OutputMode,
{
@ -1356,7 +1356,7 @@ where
}
}
impl<'d, T: Pin, MODE> embedded_hal_0_2::digital::v2::ToggleableOutputPin for PinDriver<'d, T, MODE>
impl<T: Pin, MODE> embedded_hal_0_2::digital::v2::ToggleableOutputPin for PinDriver<'_, T, MODE>
where
MODE: OutputMode,
{

View File

@ -384,15 +384,15 @@ impl<'d> I2cDriver<'d> {
}
}
impl<'d> Drop for I2cDriver<'d> {
impl Drop for I2cDriver<'_> {
fn drop(&mut self) {
esp!(unsafe { i2c_driver_delete(self.port()) }).unwrap();
}
}
unsafe impl<'d> Send for I2cDriver<'d> {}
unsafe impl Send for I2cDriver<'_> {}
impl<'d> embedded_hal_0_2::blocking::i2c::Read for I2cDriver<'d> {
impl embedded_hal_0_2::blocking::i2c::Read for I2cDriver<'_> {
type Error = I2cError;
fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Self::Error> {
@ -400,7 +400,7 @@ impl<'d> embedded_hal_0_2::blocking::i2c::Read for I2cDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::blocking::i2c::Write for I2cDriver<'d> {
impl embedded_hal_0_2::blocking::i2c::Write for I2cDriver<'_> {
type Error = I2cError;
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error> {
@ -408,7 +408,7 @@ impl<'d> embedded_hal_0_2::blocking::i2c::Write for I2cDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::blocking::i2c::WriteRead for I2cDriver<'d> {
impl embedded_hal_0_2::blocking::i2c::WriteRead for I2cDriver<'_> {
type Error = I2cError;
fn write_read(&mut self, addr: u8, bytes: &[u8], buffer: &mut [u8]) -> Result<(), Self::Error> {
@ -416,11 +416,11 @@ impl<'d> embedded_hal_0_2::blocking::i2c::WriteRead for I2cDriver<'d> {
}
}
impl<'d> embedded_hal::i2c::ErrorType for I2cDriver<'d> {
impl embedded_hal::i2c::ErrorType for I2cDriver<'_> {
type Error = I2cError;
}
impl<'d> embedded_hal::i2c::I2c<embedded_hal::i2c::SevenBitAddress> for I2cDriver<'d> {
impl embedded_hal::i2c::I2c<embedded_hal::i2c::SevenBitAddress> for I2cDriver<'_> {
fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Self::Error> {
I2cDriver::read(self, addr, buffer, BLOCK).map_err(to_i2c_err)
}
@ -457,7 +457,7 @@ pub struct I2cSlaveDriver<'d> {
}
#[cfg(not(esp32c2))]
unsafe impl<'d> Send for I2cSlaveDriver<'d> {}
unsafe impl Send for I2cSlaveDriver<'_> {}
#[cfg(not(esp32c2))]
impl<'d> I2cSlaveDriver<'d> {
@ -534,7 +534,7 @@ impl<'d> I2cSlaveDriver<'d> {
}
#[cfg(not(esp32c2))]
impl<'d> Drop for I2cSlaveDriver<'d> {
impl Drop for I2cSlaveDriver<'_> {
fn drop(&mut self) {
esp!(unsafe { i2c_driver_delete(self.port()) }).unwrap();
}
@ -582,7 +582,7 @@ impl<'buffers> CommandLink<'buffers> {
}
}
impl<'buffers> Drop for CommandLink<'buffers> {
impl Drop for CommandLink<'_> {
fn drop(&mut self) {
unsafe {
i2c_cmd_link_delete(self.0);

View File

@ -593,7 +593,7 @@ impl<'d, Dir> Deref for I2sDriverRef<'d, Dir> {
}
}
impl<'d, Dir> DerefMut for I2sDriverRef<'d, Dir> {
impl<Dir> DerefMut for I2sDriverRef<'_, Dir> {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { self.0.as_mut() }
}
@ -619,7 +619,7 @@ pub struct I2sDriver<'d, Dir> {
_dir: PhantomData<Dir>,
}
impl<'d, Dir> I2sDriver<'d, Dir> {
impl<Dir> I2sDriver<'_, Dir> {
/// Create a new standard mode driver for the given I2S peripheral with both the receive and transmit channels open.
#[cfg(not(esp_idf_version_major = "4"))]
fn internal_new<I2S: I2s>(
@ -1215,7 +1215,7 @@ where
}
}
impl<'d> I2sDriver<'d, I2sBiDir> {
impl I2sDriver<'_, I2sBiDir> {
/// Split the bidirectional I2S driver into two parts (Rx, Tx)
///
/// # Safety
@ -1230,7 +1230,7 @@ impl<'d> I2sDriver<'d, I2sBiDir> {
}
}
impl<'d, Dir> Drop for I2sDriver<'d, Dir> {
impl<Dir> Drop for I2sDriver<'_, Dir> {
fn drop(&mut self) {
#[cfg(esp_idf_version_major = "4")]
{
@ -1266,19 +1266,19 @@ impl<'d, Dir> Drop for I2sDriver<'d, Dir> {
}
}
unsafe impl<'d, Dir> Send for I2sDriver<'d, Dir> {}
unsafe impl<Dir> Send for I2sDriver<'_, Dir> {}
impl<'d, Dir> I2sPort for I2sDriver<'d, Dir> {
impl<Dir> I2sPort for I2sDriver<'_, Dir> {
fn port(&self) -> i2s_port_t {
self.port as _
}
}
impl<'d, Dir> embedded_io::ErrorType for I2sDriver<'d, Dir> {
impl<Dir> embedded_io::ErrorType for I2sDriver<'_, Dir> {
type Error = EspIOError;
}
impl<'d, Dir> embedded_io::Read for I2sDriver<'d, Dir>
impl<Dir> embedded_io::Read for I2sDriver<'_, Dir>
where
Dir: I2sRxSupported,
{
@ -1287,7 +1287,7 @@ where
}
}
impl<'d, Dir> embedded_io::Write for I2sDriver<'d, Dir>
impl<Dir> embedded_io::Write for I2sDriver<'_, Dir>
where
Dir: I2sTxSupported,
{

View File

@ -262,7 +262,7 @@ unsafe impl Sync for IsrCriticalSection {}
pub struct IsrCriticalSectionGuard<'a>(&'a IsrCriticalSection);
impl<'a> Drop for IsrCriticalSectionGuard<'a> {
impl Drop for IsrCriticalSectionGuard<'_> {
/// Drops the critical section guard thus potentially re-enabling
/// al interrupts for the currently active core.
///

View File

@ -171,7 +171,7 @@ where
}
}
impl<'d, T> Drop for LedcTimerDriver<'d, T>
impl<T> Drop for LedcTimerDriver<'_, T>
where
T: LedcTimer,
{
@ -180,7 +180,7 @@ where
}
}
unsafe impl<'d, T> Send for LedcTimerDriver<'d, T> where T: LedcTimer {}
unsafe impl<T> Send for LedcTimerDriver<'_, T> where T: LedcTimer {}
/// LED Control driver
pub struct LedcDriver<'d> {
@ -325,15 +325,15 @@ impl<'d> LedcDriver<'d> {
}
}
impl<'d> Drop for LedcDriver<'d> {
impl Drop for LedcDriver<'_> {
fn drop(&mut self) {
self.stop().unwrap();
}
}
unsafe impl<'d> Send for LedcDriver<'d> {}
unsafe impl Send for LedcDriver<'_> {}
impl<'d> embedded_hal::pwm::ErrorType for LedcDriver<'d> {
impl embedded_hal::pwm::ErrorType for LedcDriver<'_> {
type Error = PwmError;
}
@ -341,7 +341,7 @@ fn to_pwm_err(err: EspError) -> PwmError {
PwmError::other(err)
}
impl<'d> embedded_hal::pwm::SetDutyCycle for LedcDriver<'d> {
impl embedded_hal::pwm::SetDutyCycle for LedcDriver<'_> {
fn max_duty_cycle(&self) -> u16 {
let duty = self.get_max_duty();
let duty_cap: u16 = if duty > u16::MAX as u32 {
@ -374,7 +374,7 @@ impl<'d> embedded_hal::pwm::SetDutyCycle for LedcDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::PwmPin for LedcDriver<'d> {
impl embedded_hal_0_2::PwmPin for LedcDriver<'_> {
type Duty = Duty;
fn disable(&mut self) {

View File

@ -75,7 +75,7 @@ impl<'a, T> PeripheralRef<'a, T> {
}
}
impl<'a, T> Deref for PeripheralRef<'a, T> {
impl<T> Deref for PeripheralRef<'_, T> {
type Target = T;
#[inline]
@ -84,7 +84,7 @@ impl<'a, T> Deref for PeripheralRef<'a, T> {
}
}
impl<'a, T> DerefMut for PeripheralRef<'a, T> {
impl<T> DerefMut for PeripheralRef<'_, T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner

View File

@ -611,13 +611,13 @@ impl<'d> SpiDriver<'d> {
}
}
impl<'d> Drop for SpiDriver<'d> {
impl Drop for SpiDriver<'_> {
fn drop(&mut self) {
esp!(unsafe { spi_bus_free(self.host()) }).unwrap();
}
}
unsafe impl<'d> Send for SpiDriver<'d> {}
unsafe impl Send for SpiDriver<'_> {}
pub struct SpiBusDriver<'d, T>
where
@ -1697,7 +1697,7 @@ where
},
}
impl<'c, 'p, P, M> CsCtl<'c, 'p, P, M>
impl<P, M> CsCtl<'_, '_, P, M>
where
P: OutputPin,
M: OutputMode,

View File

@ -559,7 +559,7 @@ unsafe impl Sync for CriticalSection {}
pub struct CriticalSectionGuard<'a>(&'a CriticalSection);
impl<'a> Drop for CriticalSectionGuard<'a> {
impl Drop for CriticalSectionGuard<'_> {
#[inline(always)]
#[link_section = ".iram1.csg_drop"]
fn drop(&mut self) {

View File

@ -185,6 +185,6 @@ impl Drop for TempSensorDriver<'_> {
}
}
unsafe impl<'d> Send for TempSensorDriver<'d> {}
unsafe impl Send for TempSensorDriver<'_> {}
crate::impl_peripheral!(TempSensor);

View File

@ -547,7 +547,7 @@ impl<'d> TimerDriver<'d> {
}
}
impl<'d> Drop for TimerDriver<'d> {
impl Drop for TimerDriver<'_> {
fn drop(&mut self) {
self.disable_interrupt().unwrap();
@ -562,7 +562,7 @@ impl<'d> Drop for TimerDriver<'d> {
}
}
unsafe impl<'d> Send for TimerDriver<'d> {}
unsafe impl Send for TimerDriver<'_> {}
impl<'d> embedded_hal_async::delay::DelayNs for TimerDriver<'d> {
async fn delay_ns(&mut self, ns: u32) {

View File

@ -716,8 +716,8 @@ pub struct UartDriver<'d> {
_p: PhantomData<&'d mut ()>,
}
unsafe impl<'d> Send for UartDriver<'d> {}
unsafe impl<'d> Sync for UartDriver<'d> {}
unsafe impl Send for UartDriver<'_> {}
unsafe impl Sync for UartDriver<'_> {}
/// Serial receiver
pub struct UartRxDriver<'d> {
@ -965,23 +965,23 @@ impl<'d> UartDriver<'d> {
}
}
impl<'d> Drop for UartDriver<'d> {
impl Drop for UartDriver<'_> {
fn drop(&mut self) {
delete_driver(self.port()).unwrap();
}
}
impl<'d> embedded_io::ErrorType for UartDriver<'d> {
impl embedded_io::ErrorType for UartDriver<'_> {
type Error = EspIOError;
}
impl<'d> embedded_io::Read for UartDriver<'d> {
impl embedded_io::Read for UartDriver<'_> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
UartDriver::read(self, buf, delay::BLOCK).map_err(EspIOError)
}
}
impl<'d> embedded_io::Write for UartDriver<'d> {
impl embedded_io::Write for UartDriver<'_> {
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
UartDriver::write(self, buf).map_err(EspIOError)
}
@ -991,7 +991,7 @@ impl<'d> embedded_io::Write for UartDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::serial::Read<u8> for UartDriver<'d> {
impl embedded_hal_0_2::serial::Read<u8> for UartDriver<'_> {
type Error = SerialError;
fn read(&mut self) -> nb::Result<u8, Self::Error> {
@ -999,7 +999,7 @@ impl<'d> embedded_hal_0_2::serial::Read<u8> for UartDriver<'d> {
}
}
impl<'d> embedded_hal_0_2::serial::Write<u8> for UartDriver<'d> {
impl embedded_hal_0_2::serial::Write<u8> for UartDriver<'_> {
type Error = SerialError;
fn flush(&mut self) -> nb::Result<(), Self::Error> {
@ -1011,17 +1011,17 @@ impl<'d> embedded_hal_0_2::serial::Write<u8> for UartDriver<'d> {
}
}
impl<'d> embedded_hal_nb::serial::ErrorType for UartDriver<'d> {
impl embedded_hal_nb::serial::ErrorType for UartDriver<'_> {
type Error = SerialError;
}
impl<'d> embedded_hal_nb::serial::Read<u8> for UartDriver<'d> {
impl embedded_hal_nb::serial::Read<u8> for UartDriver<'_> {
fn read(&mut self) -> nb::Result<u8, Self::Error> {
embedded_hal_nb::serial::Read::read(&mut *self.rx())
}
}
impl<'d> embedded_hal_nb::serial::Write<u8> for UartDriver<'d> {
impl embedded_hal_nb::serial::Write<u8> for UartDriver<'_> {
fn write(&mut self, byte: u8) -> nb::Result<(), Self::Error> {
embedded_hal_nb::serial::Write::write(&mut *self.tx(), byte)
}
@ -1031,7 +1031,7 @@ impl<'d> embedded_hal_nb::serial::Write<u8> for UartDriver<'d> {
}
}
impl<'d> core::fmt::Write for UartDriver<'d> {
impl core::fmt::Write for UartDriver<'_> {
fn write_str(&mut self, s: &str) -> core::fmt::Result {
self.tx().write_str(s)
}
@ -1220,23 +1220,23 @@ impl<'d> UartRxDriver<'d> {
}
}
impl<'d> Drop for UartRxDriver<'d> {
impl Drop for UartRxDriver<'_> {
fn drop(&mut self) {
self.owner.drop_impl(self.port()).unwrap()
}
}
impl<'d> embedded_io::ErrorType for UartRxDriver<'d> {
impl embedded_io::ErrorType for UartRxDriver<'_> {
type Error = EspIOError;
}
impl<'d> embedded_io::Read for UartRxDriver<'d> {
impl embedded_io::Read for UartRxDriver<'_> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
UartRxDriver::read(self, buf, delay::BLOCK).map_err(EspIOError)
}
}
impl<'d> embedded_hal_0_2::serial::Read<u8> for UartRxDriver<'d> {
impl embedded_hal_0_2::serial::Read<u8> for UartRxDriver<'_> {
type Error = SerialError;
fn read(&mut self) -> nb::Result<u8, Self::Error> {
@ -1248,11 +1248,11 @@ impl<'d> embedded_hal_0_2::serial::Read<u8> for UartRxDriver<'d> {
}
}
impl<'d> embedded_hal_nb::serial::ErrorType for UartRxDriver<'d> {
impl embedded_hal_nb::serial::ErrorType for UartRxDriver<'_> {
type Error = SerialError;
}
impl<'d> embedded_hal_nb::serial::Read<u8> for UartRxDriver<'d> {
impl embedded_hal_nb::serial::Read<u8> for UartRxDriver<'_> {
fn read(&mut self) -> nb::Result<u8, Self::Error> {
let mut buf = [0_u8];
@ -1415,13 +1415,13 @@ impl<'d> UartTxDriver<'d> {
}
}
impl<'d> Drop for UartTxDriver<'d> {
impl Drop for UartTxDriver<'_> {
fn drop(&mut self) {
self.owner.drop_impl(self.port()).unwrap()
}
}
impl<'d> embedded_io::Write for UartTxDriver<'d> {
impl embedded_io::Write for UartTxDriver<'_> {
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
UartTxDriver::write(self, buf).map_err(EspIOError)
}
@ -1431,11 +1431,11 @@ impl<'d> embedded_io::Write for UartTxDriver<'d> {
}
}
impl<'d> embedded_io::ErrorType for UartTxDriver<'d> {
impl embedded_io::ErrorType for UartTxDriver<'_> {
type Error = EspIOError;
}
impl<'d> embedded_hal_0_2::serial::Write<u8> for UartTxDriver<'d> {
impl embedded_hal_0_2::serial::Write<u8> for UartTxDriver<'_> {
type Error = SerialError;
fn flush(&mut self) -> nb::Result<(), Self::Error> {
@ -1447,11 +1447,11 @@ impl<'d> embedded_hal_0_2::serial::Write<u8> for UartTxDriver<'d> {
}
}
impl<'d> embedded_hal_nb::serial::ErrorType for UartTxDriver<'d> {
impl embedded_hal_nb::serial::ErrorType for UartTxDriver<'_> {
type Error = SerialError;
}
impl<'d> embedded_hal_nb::serial::Write<u8> for UartTxDriver<'d> {
impl embedded_hal_nb::serial::Write<u8> for UartTxDriver<'_> {
fn flush(&mut self) -> nb::Result<(), Self::Error> {
check_nb_timeout(UartTxDriver::wait_done(self, delay::NON_BLOCK))
}
@ -1461,7 +1461,7 @@ impl<'d> embedded_hal_nb::serial::Write<u8> for UartTxDriver<'d> {
}
}
impl<'d> core::fmt::Write for UartTxDriver<'d> {
impl core::fmt::Write for UartTxDriver<'_> {
fn write_str(&mut self, s: &str) -> core::fmt::Result {
let buf = s.as_bytes();
let mut offset = 0;