diff --git a/src/bt.rs b/src/bt.rs index 619104fce01..8ba1b35803d 100644 --- a/src/bt.rs +++ b/src/bt.rs @@ -709,7 +709,7 @@ where } } -impl<'d, M> Drop for BtDriver<'d, M> +impl Drop for BtDriver<'_, M> where M: BtMode, { @@ -724,5 +724,5 @@ where } } -unsafe impl<'d, M> Send for BtDriver<'d, M> where M: BtMode {} -unsafe impl<'d, M> Sync for BtDriver<'d, M> where M: BtMode {} +unsafe impl Send for BtDriver<'_, M> where M: BtMode {} +unsafe impl Sync for BtDriver<'_, M> where M: BtMode {} diff --git a/src/bt/ble/gap.rs b/src/bt/ble/gap.rs index 8e374d04645..a7e9e092562 100644 --- a/src/bt/ble/gap.rs +++ b/src/bt/ble/gap.rs @@ -182,7 +182,7 @@ pub struct AdvConfiguration<'a> { pub manufacturer_data: Option<&'a [u8]>, } -impl<'a> Default for AdvConfiguration<'a> { +impl Default for AdvConfiguration<'_> { fn default() -> Self { Self { set_scan_rsp: false, @@ -231,7 +231,7 @@ impl<'a> From<&'a AdvConfiguration<'a>> for esp_ble_adv_data_t { pub struct EventRawData<'a>(pub &'a esp_ble_gap_cb_param_t); -impl<'a> Debug for EventRawData<'a> { +impl Debug for EventRawData<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("EventRawData").finish() } diff --git a/src/bt/ble/gatt/server.rs b/src/bt/ble/gatt/server.rs index fcb00957b83..8ececc6f36f 100644 --- a/src/bt/ble/gatt/server.rs +++ b/src/bt/ble/gatt/server.rs @@ -18,7 +18,7 @@ pub type TransferId = u32; pub struct EventRawData<'a>(pub &'a esp_ble_gatts_cb_param_t); -impl<'a> Debug for EventRawData<'a> { +impl Debug for EventRawData<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("EventRawData").finish() } diff --git a/src/espnow.rs b/src/espnow.rs index 0bae195c41f..e2dd85901aa 100644 --- a/src/espnow.rs +++ b/src/espnow.rs @@ -241,7 +241,7 @@ impl<'a> EspNow<'a> { } } -impl<'a> Drop for EspNow<'a> { +impl Drop for EspNow<'_> { fn drop(&mut self) { let mut taken = TAKEN.lock(); diff --git a/src/eth.rs b/src/eth.rs index 64e21f8a764..429847e1ade 100644 --- a/src/eth.rs +++ b/src/eth.rs @@ -1076,7 +1076,7 @@ impl<'d, T> EthDriver<'d, T> { } } -impl<'d, T> Eth for EthDriver<'d, T> { +impl Eth for EthDriver<'_, T> { type Error = EspError; fn start(&mut self) -> Result<(), Self::Error> { @@ -1096,9 +1096,9 @@ impl<'d, T> Eth for EthDriver<'d, T> { } } -unsafe impl<'d, T> Send for EthDriver<'d, T> {} +unsafe impl Send for EthDriver<'_, T> {} -impl<'d, T> Drop for EthDriver<'d, T> { +impl Drop for EthDriver<'_, T> { fn drop(&mut self) { self.clear_all().unwrap(); @@ -1106,7 +1106,7 @@ impl<'d, T> Drop for EthDriver<'d, T> { } } -impl<'d, T> RawHandle for EthDriver<'d, T> { +impl RawHandle for EthDriver<'_, T> { type Handle = esp_eth_handle_t; fn handle(&self) -> Self::Handle { @@ -1261,7 +1261,7 @@ impl<'d, T> EspEth<'d, T> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d, T> Drop for EspEth<'d, T> { +impl Drop for EspEth<'_, T> { fn drop(&mut self) { self.detach_netif().unwrap(); @@ -1270,10 +1270,10 @@ impl<'d, T> Drop for EspEth<'d, T> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -unsafe impl<'d, T> Send for EspEth<'d, T> {} +unsafe impl Send for EspEth<'_, T> {} #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d, T> RawHandle for EspEth<'d, T> { +impl RawHandle for EspEth<'_, T> { type Handle = *mut esp_eth_netif_glue_t; fn handle(&self) -> Self::Handle { @@ -1282,7 +1282,7 @@ impl<'d, T> RawHandle for EspEth<'d, T> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d, T> Eth for EspEth<'d, T> { +impl Eth for EspEth<'_, T> { type Error = EspError; fn start(&mut self) -> Result<(), Self::Error> { @@ -1303,7 +1303,7 @@ impl<'d, T> Eth for EspEth<'d, T> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d, T> NetifStatus for EspEth<'d, T> { +impl NetifStatus for EspEth<'_, T> { fn is_up(&self) -> Result { EspEth::is_up(self) } diff --git a/src/eventloop.rs b/src/eventloop.rs index 1a3484dd7d4..3b32e404fd5 100644 --- a/src/eventloop.rs +++ b/src/eventloop.rs @@ -49,7 +49,7 @@ pub struct BackgroundLoopConfiguration<'a> { pub task_pin_to_core: Core, } -impl<'a> Default for BackgroundLoopConfiguration<'a> { +impl Default for BackgroundLoopConfiguration<'_> { fn default() -> Self { Self { queue_size: 64, @@ -217,13 +217,13 @@ impl<'a> EspEventPostData<'a> { } } -unsafe impl<'a> EspEventSource for EspEventPostData<'a> { +unsafe impl EspEventSource for EspEventPostData<'_> { fn source() -> Option<&'static ffi::CStr> { None } } -impl<'a> EspEventSerializer for EspEventPostData<'a> { +impl EspEventSerializer for EspEventPostData<'_> { type Data<'d> = EspEventPostData<'d>; fn serialize(data: &Self::Data<'_>, f: F) -> R @@ -268,13 +268,13 @@ impl<'a> EspEvent<'a> { } } -unsafe impl<'a> EspEventSource for EspEvent<'a> { +unsafe impl EspEventSource for EspEvent<'_> { fn source() -> Option<&'static ffi::CStr> { None } } -impl<'a> EspEventDeserializer for EspEvent<'a> { +impl EspEventDeserializer for EspEvent<'_> { type Data<'d> = EspEvent<'d>; fn deserialize<'d>(data: &EspEvent<'d>) -> Self::Data<'d> { @@ -343,7 +343,7 @@ where _callback: Box>, } -impl<'a, T> EspSubscription<'a, T> +impl EspSubscription<'_, T> where T: EspEventLoopType, { @@ -369,9 +369,9 @@ where } } -unsafe impl<'a, T> Send for EspSubscription<'a, T> where T: EspEventLoopType {} +unsafe impl Send for EspSubscription<'_, T> where T: EspEventLoopType {} -impl<'a, T> Drop for EspSubscription<'a, T> +impl Drop for EspSubscription<'_, T> where T: EspEventLoopType, { @@ -404,7 +404,7 @@ where } } -impl<'a, T> RawHandle for EspSubscription<'a, User> +impl RawHandle for EspSubscription<'_, User> where T: EspEventLoopType, { diff --git a/src/fs/fatfs.rs b/src/fs/fatfs.rs index 11b3a7f27d9..4cc744866f5 100644 --- a/src/fs/fatfs.rs +++ b/src/fs/fatfs.rs @@ -80,7 +80,7 @@ pub struct MountedFatfs<'a, T> { fatfs: Box, } -impl<'a, T> MountedFatfs<'a, T> { +impl MountedFatfs<'_, T> { /// Get the underlying FATFS instance. pub fn fatfs(&self) -> &FATFS { &self.fatfs @@ -89,7 +89,7 @@ impl<'a, T> MountedFatfs<'a, T> { // TODO: Add safe methods to interact with the filesystem } -impl<'a, T> Drop for MountedFatfs<'a, T> { +impl Drop for MountedFatfs<'_, T> { fn drop(&mut self) { let drive_path = self.fs.drive_path(); diff --git a/src/http/server.rs b/src/http/server.rs index 5a0292db5d3..bdd02d18e6a 100644 --- a/src/http/server.rs +++ b/src/http/server.rs @@ -670,13 +670,13 @@ impl<'a> EspHttpServer<'a> { } } -impl<'a> Drop for EspHttpServer<'a> { +impl Drop for EspHttpServer<'_> { fn drop(&mut self) { self.stop().expect("Unable to stop the server cleanly"); } } -impl<'a> RawHandle for EspHttpServer<'a> { +impl RawHandle for EspHttpServer<'_> { type Handle = httpd_handle_t; fn handle(&self) -> Self::Handle { @@ -740,7 +740,7 @@ impl NonstaticChain { } } -unsafe impl<'a> EspHttpTraversableChainNonstatic<'a> for ChainRoot {} +unsafe impl EspHttpTraversableChainNonstatic<'_> for ChainRoot {} impl<'a, H, N> EspHttpTraversableChain<'a> for NonstaticChain where @@ -767,7 +767,7 @@ where pub struct EspHttpRawConnection<'a>(&'a mut httpd_req_t); -impl<'a> EspHttpRawConnection<'a> { +impl EspHttpRawConnection<'_> { pub fn read(&mut self, buf: &mut [u8]) -> Result { if !buf.is_empty() { let fd = unsafe { httpd_req_to_sockfd(self.0) }; @@ -801,7 +801,7 @@ impl<'a> EspHttpRawConnection<'a> { } } -impl<'a> RawHandle for EspHttpRawConnection<'a> { +impl RawHandle for EspHttpRawConnection<'_> { type Handle = *mut httpd_req_t; fn handle(&self) -> Self::Handle { @@ -809,17 +809,17 @@ impl<'a> RawHandle for EspHttpRawConnection<'a> { } } -impl<'a> ErrorType for EspHttpRawConnection<'a> { +impl ErrorType for EspHttpRawConnection<'_> { type Error = EspIOError; } -impl<'a> Read for EspHttpRawConnection<'a> { +impl Read for EspHttpRawConnection<'_> { fn read(&mut self, buf: &mut [u8]) -> Result { EspHttpRawConnection::read(self, buf).map_err(EspIOError) } } -impl<'a> Write for EspHttpRawConnection<'a> { +impl Write for EspHttpRawConnection<'_> { fn write(&mut self, buf: &[u8]) -> Result { EspHttpRawConnection::write(self, buf).map_err(EspIOError) } @@ -1130,7 +1130,7 @@ impl<'a> EspHttpConnection<'a> { } } -impl<'a> RawHandle for EspHttpConnection<'a> { +impl RawHandle for EspHttpConnection<'_> { type Handle = *mut httpd_req_t; fn handle(&self) -> Self::Handle { @@ -1138,7 +1138,7 @@ impl<'a> RawHandle for EspHttpConnection<'a> { } } -impl<'a> Query for EspHttpConnection<'a> { +impl Query for EspHttpConnection<'_> { fn uri(&self) -> &str { EspHttpConnection::uri(self) } @@ -1148,23 +1148,23 @@ impl<'a> Query for EspHttpConnection<'a> { } } -impl<'a> embedded_svc::http::Headers for EspHttpConnection<'a> { +impl embedded_svc::http::Headers for EspHttpConnection<'_> { fn header(&self, name: &str) -> Option<&str> { EspHttpConnection::header(self, name) } } -impl<'a> ErrorType for EspHttpConnection<'a> { +impl ErrorType for EspHttpConnection<'_> { type Error = EspIOError; } -impl<'a> Read for EspHttpConnection<'a> { +impl Read for EspHttpConnection<'_> { fn read(&mut self, buf: &mut [u8]) -> Result { EspHttpConnection::read(self, buf).map_err(EspIOError) } } -impl<'a> Write for EspHttpConnection<'a> { +impl Write for EspHttpConnection<'_> { fn write(&mut self, buf: &[u8]) -> Result { EspHttpConnection::write(self, buf).map_err(EspIOError) } diff --git a/src/mqtt/client.rs b/src/mqtt/client.rs index 2a156a7cf78..a26e9e8ad05 100644 --- a/src/mqtt/client.rs +++ b/src/mqtt/client.rs @@ -88,7 +88,7 @@ pub struct MqttClientConfiguration<'a> { // void *ds_data; /*!< carrier of handle for digital signature parameters */ } -impl<'a> Default for MqttClientConfiguration<'a> { +impl Default for MqttClientConfiguration<'_> { fn default() -> Self { Self { protocol_version: None, @@ -353,7 +353,7 @@ pub struct EspMqttClient<'a> { _tls_psk_conf: Option, } -impl<'a> RawHandle for EspMqttClient<'a> { +impl RawHandle for EspMqttClient<'_> { type Handle = esp_mqtt_client_handle_t; fn handle(&self) -> Self::Handle { @@ -644,7 +644,7 @@ impl<'a> EspMqttClient<'a> { } } -impl<'a> Drop for EspMqttClient<'a> { +impl Drop for EspMqttClient<'_> { fn drop(&mut self) { unsafe { esp_mqtt_client_destroy(self.raw_client as _); @@ -652,11 +652,11 @@ impl<'a> Drop for EspMqttClient<'a> { } } -impl<'a> ErrorType for EspMqttClient<'a> { +impl ErrorType for EspMqttClient<'_> { type Error = EspError; } -impl<'a> Client for EspMqttClient<'a> { +impl Client for EspMqttClient<'_> { fn subscribe(&mut self, topic: &str, qos: QoS) -> Result { EspMqttClient::subscribe(self, topic, qos) } @@ -666,7 +666,7 @@ impl<'a> Client for EspMqttClient<'a> { } } -impl<'a> Publish for EspMqttClient<'a> { +impl Publish for EspMqttClient<'_> { fn publish( &mut self, topic: &str, @@ -678,7 +678,7 @@ impl<'a> Publish for EspMqttClient<'a> { } } -impl<'a> Enqueue for EspMqttClient<'a> { +impl Enqueue for EspMqttClient<'_> { fn enqueue( &mut self, topic: &str, @@ -690,7 +690,7 @@ impl<'a> Enqueue for EspMqttClient<'a> { } } -unsafe impl<'a> Send for EspMqttClient<'a> {} +unsafe impl Send for EspMqttClient<'_> {} pub struct EspMqttConnection { receiver: Receiver>, @@ -1025,16 +1025,16 @@ impl<'a> EspMqttEvent<'a> { } /// SAFETY: EspMqttEvent contains no thread-specific data. -unsafe impl<'a> Send for EspMqttEvent<'a> {} +unsafe impl Send for EspMqttEvent<'_> {} /// SAFETY: EspMqttEvent is a read-only struct, so sharing it between threads is fine. -unsafe impl<'a> Sync for EspMqttEvent<'a> {} +unsafe impl Sync for EspMqttEvent<'_> {} -impl<'a> ErrorType for EspMqttEvent<'a> { +impl ErrorType for EspMqttEvent<'_> { type Error = EspError; } -impl<'a> Event for EspMqttEvent<'a> { +impl Event for EspMqttEvent<'_> { fn payload(&self) -> EventPayload<'_, Self::Error> { EspMqttEvent::payload(self) } diff --git a/src/netif.rs b/src/netif.rs index 757af293772..97493715010 100644 --- a/src/netif.rs +++ b/src/netif.rs @@ -667,7 +667,7 @@ impl fmt::Debug for ApStaIpAssignment<'_> { #[derive(Copy, Clone)] pub struct DhcpIpAssignment<'a>(&'a ip_event_got_ip_t); -impl<'a> DhcpIpAssignment<'a> { +impl DhcpIpAssignment<'_> { pub fn netif_handle(&self) -> *mut esp_netif_t { self.0.esp_netif } @@ -701,7 +701,7 @@ impl<'a> DhcpIpAssignment<'a> { } } -impl<'a> fmt::Debug for DhcpIpAssignment<'a> { +impl fmt::Debug for DhcpIpAssignment<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("DhcpIpAssignment") .field("netif_handle", &self.netif_handle()) @@ -716,7 +716,7 @@ impl<'a> fmt::Debug for DhcpIpAssignment<'a> { #[derive(Copy, Clone)] pub struct DhcpIp6Assignment<'a>(&'a ip_event_got_ip6_t); -impl<'a> DhcpIp6Assignment<'a> { +impl DhcpIp6Assignment<'_> { pub fn netif_handle(&self) -> *mut esp_netif_t { self.0.esp_netif } @@ -738,7 +738,7 @@ impl<'a> DhcpIp6Assignment<'a> { } } -impl<'a> fmt::Debug for DhcpIp6Assignment<'a> { +impl fmt::Debug for DhcpIp6Assignment<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("DhcpIp6Assignment") .field("netif_handle", &self.netif_handle()) @@ -757,9 +757,9 @@ pub enum IpEvent<'a> { DhcpIpDeassigned(*mut esp_netif_t), } -unsafe impl<'a> Send for IpEvent<'a> {} +unsafe impl Send for IpEvent<'_> {} -impl<'a> IpEvent<'a> { +impl IpEvent<'_> { pub fn is_for(&self, raw_handle: &impl RawHandle) -> bool { self.is_for_handle(raw_handle.handle()) } @@ -783,13 +783,13 @@ impl<'a> IpEvent<'a> { } } -unsafe impl<'a> EspEventSource for IpEvent<'a> { +unsafe impl EspEventSource for IpEvent<'_> { fn source() -> Option<&'static ffi::CStr> { Some(unsafe { CStr::from_ptr(IP_EVENT) }) } } -impl<'a> EspEventDeserializer for IpEvent<'a> { +impl EspEventDeserializer for IpEvent<'_> { type Data<'d> = IpEvent<'d>; #[allow(non_upper_case_globals, non_snake_case)] @@ -1213,7 +1213,7 @@ mod driver { } } - impl<'d, T> Drop for EspNetifDriver<'d, T> + impl Drop for EspNetifDriver<'_, T> where T: BorrowMut, { @@ -1258,7 +1258,7 @@ mod driver { alloc::boxed::Box Result<(), EspError> + Send + 'd>, } - impl<'d, T> EspNetifDriverInner<'d, T> + impl EspNetifDriverInner<'_, T> where T: BorrowMut, { diff --git a/src/ota.rs b/src/ota.rs index 892d95b6a44..4313e51c942 100644 --- a/src/ota.rs +++ b/src/ota.rs @@ -217,7 +217,7 @@ pub struct EspOtaUpdateFinished<'a> { _data: PhantomData<&'a mut ()>, } -impl<'a> EspOtaUpdateFinished<'a> { +impl EspOtaUpdateFinished<'_> { pub fn activate(self) -> Result<(), EspError> { esp!(unsafe { esp_ota_set_boot_partition(self.update_partition) }) } @@ -440,9 +440,9 @@ impl Ota for EspOta { } } -unsafe impl<'a> Send for EspOtaUpdate<'a> {} +unsafe impl Send for EspOtaUpdate<'_> {} -impl<'a> io::ErrorType for EspOtaUpdate<'a> { +impl io::ErrorType for EspOtaUpdate<'_> { type Error = EspIOError; } @@ -468,7 +468,7 @@ impl<'a> OtaUpdate for EspOtaUpdate<'a> { } } -impl<'a> io::Write for EspOtaUpdate<'a> { +impl io::Write for EspOtaUpdate<'_> { fn write(&mut self, buf: &[u8]) -> Result { EspOtaUpdate::write(self, buf)?; @@ -482,13 +482,13 @@ impl<'a> io::Write for EspOtaUpdate<'a> { } } -unsafe impl<'a> Send for EspOtaUpdateFinished<'a> {} +unsafe impl Send for EspOtaUpdateFinished<'_> {} -impl<'a> io::ErrorType for EspOtaUpdateFinished<'a> { +impl io::ErrorType for EspOtaUpdateFinished<'_> { type Error = EspIOError; } -impl<'a> OtaUpdateFinished for EspOtaUpdateFinished<'a> { +impl OtaUpdateFinished for EspOtaUpdateFinished<'_> { fn activate(self) -> Result<(), Self::Error> { EspOtaUpdateFinished::activate(self)?; diff --git a/src/private/mutex.rs b/src/private/mutex.rs index 1e2480462bc..d2fbb2cfee1 100644 --- a/src/private/mutex.rs +++ b/src/private/mutex.rs @@ -134,7 +134,7 @@ impl<'a, T> MutexGuard<'a, T> { } } -impl<'a, T> Drop for MutexGuard<'a, T> { +impl Drop for MutexGuard<'_, T> { #[inline(always)] fn drop(&mut self) { unsafe { @@ -143,7 +143,7 @@ impl<'a, T> Drop for MutexGuard<'a, T> { } } -impl<'a, T> Deref for MutexGuard<'a, T> { +impl Deref for MutexGuard<'_, T> { type Target = T; #[inline(always)] @@ -152,7 +152,7 @@ impl<'a, T> Deref for MutexGuard<'a, T> { } } -impl<'a, T> DerefMut for MutexGuard<'a, T> { +impl DerefMut for MutexGuard<'_, T> { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { unsafe { self.0 .1.get().as_mut().unwrap() } diff --git a/src/private/zerocopy.rs b/src/private/zerocopy.rs index c631480d718..0ccd55e4323 100644 --- a/src/private/zerocopy.rs +++ b/src/private/zerocopy.rs @@ -89,6 +89,8 @@ where /// /// Even though Receiver requires T: 'static, we need to implement this for all lifetimes. /// This is due to a rustc bug: https://github.com/rust-lang/rust/issues/110338 +#[allow(clippy::extra_unused_lifetimes)] +#[allow(clippy::needless_lifetimes)] unsafe impl<'a, T> Send for Receiver where T: Send + 'a {} pub struct QuitOnDrop(Arc>) @@ -202,6 +204,8 @@ where /// /// Even though Channel requires T: 'static, we need to implement this for all lifetimes. /// This is due to a rustc bug: https://github.com/rust-lang/rust/issues/110338 +#[allow(clippy::extra_unused_lifetimes)] +#[allow(clippy::needless_lifetimes)] unsafe impl<'a, T> Send for Channel where T: Send + 'a {} /// SAFETY: The channel uses a mutex to synchronize access to the shared state. @@ -210,6 +214,8 @@ unsafe impl<'a, T> Send for Channel where T: Send + 'a {} /// /// Even though Channel requires T: 'static, we need to implement this for all lifetimes. /// This is due to a rustc bug: https://github.com/rust-lang/rust/issues/110338 +#[allow(clippy::extra_unused_lifetimes)] +#[allow(clippy::needless_lifetimes)] unsafe impl<'a, T> Sync for Channel where T: Send + 'a {} #[derive(Copy, Clone, Debug)] diff --git a/src/sntp.rs b/src/sntp.rs index 3ef81bfe527..198f84236aa 100644 --- a/src/sntp.rs +++ b/src/sntp.rs @@ -147,7 +147,7 @@ pub struct SntpConf<'a> { pub sync_mode: SyncMode, } -impl<'a> Default for SntpConf<'a> { +impl Default for SntpConf<'_> { fn default() -> Self { let mut servers: [&str; SNTP_SERVER_NUM] = Default::default(); let copy_len = min(servers.len(), DEFAULT_SERVERS.len()); @@ -314,7 +314,7 @@ impl<'a> EspSntp<'a> { } } -impl<'a> Drop for EspSntp<'a> { +impl Drop for EspSntp<'_> { fn drop(&mut self) { { let mut taken = TAKEN.lock(); diff --git a/src/thread.rs b/src/thread.rs index fe608cd80b8..9354e206680 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -177,7 +177,7 @@ impl<'a> ActiveScanResult<'a> { /// Energy scan result pub struct EnergyScanResult<'a>(&'a otEnergyScanResult); -impl<'a> EnergyScanResult<'a> { +impl EnergyScanResult<'_> { /// IEEE 802.15.4 Channel pub fn channel(&self) -> u8 { self.0.mChannel @@ -216,7 +216,7 @@ impl From for Role { /// The Ipv6 packet received from Thread via the `ThreadDriver::set_rx_callback` method pub struct Ipv6Packet<'a>(&'a otMessage); -impl<'a> Ipv6Packet<'a> { +impl Ipv6Packet<'_> { pub fn raw(&self) -> &otMessage { self.0 } @@ -1027,7 +1027,7 @@ impl<'d> ThreadDriver<'d, RCP> { } } -impl<'d, T> ThreadDriver<'d, T> +impl ThreadDriver<'_, T> where T: Mode, { @@ -1132,7 +1132,7 @@ where } } -impl<'d, T> Drop for ThreadDriver<'d, T> +impl Drop for ThreadDriver<'_, T> where T: Mode, { @@ -1141,8 +1141,8 @@ where } } -unsafe impl<'d, T> Send for ThreadDriver<'d, T> where T: Mode {} -unsafe impl<'d, T> Sync for ThreadDriver<'d, T> where T: Mode {} +unsafe impl Send for ThreadDriver<'_, T> where T: Mode {} +unsafe impl Sync for ThreadDriver<'_, T> where T: Mode {} struct OtLock(PhantomData<*const ()>); @@ -1646,7 +1646,7 @@ where } #[cfg(all(esp_idf_comp_esp_netif_enabled, not(esp_idf_openthread_radio)))] -impl<'d, T> Drop for EspThread<'d, T> +impl Drop for EspThread<'_, T> where T: NetifMode, { @@ -1656,9 +1656,9 @@ where } #[cfg(all(esp_idf_comp_esp_netif_enabled, not(esp_idf_openthread_radio)))] -unsafe impl<'d, T> Send for EspThread<'d, T> where T: NetifMode {} +unsafe impl Send for EspThread<'_, T> where T: NetifMode {} #[cfg(all(esp_idf_comp_esp_netif_enabled, not(esp_idf_openthread_radio)))] -unsafe impl<'d, T> Sync for EspThread<'d, T> where T: NetifMode {} +unsafe impl Sync for EspThread<'_, T> where T: NetifMode {} /// Events reported by the Thread stack on the system event loop #[derive(Copy, Clone, Debug)] diff --git a/src/timer.rs b/src/timer.rs index dc40f4b868f..c7b9f05d43e 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -55,7 +55,7 @@ pub struct EspTimer<'a> { _callback: Box, } -impl<'a> EspTimer<'a> { +impl EspTimer<'_> { pub fn is_scheduled(&self) -> Result { Ok(unsafe { esp_timer_is_active(self.handle) }) } @@ -109,9 +109,9 @@ impl<'a> EspTimer<'a> { } } -unsafe impl<'a> Send for EspTimer<'a> {} +unsafe impl Send for EspTimer<'_> {} -impl<'a> Drop for EspTimer<'a> { +impl Drop for EspTimer<'_> { fn drop(&mut self) { self.cancel().unwrap(); @@ -123,7 +123,7 @@ impl<'a> Drop for EspTimer<'a> { } } -impl<'a> RawHandle for EspTimer<'a> { +impl RawHandle for EspTimer<'_> { type Handle = esp_timer_handle_t; fn handle(&self) -> Self::Handle { diff --git a/src/tls.rs b/src/tls.rs index b61018a8369..298a94b73b9 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -20,7 +20,7 @@ pub struct Psk<'a> { pub hint: &'a str, } -impl<'a> Debug for Psk<'a> { +impl Debug for Psk<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { f.debug_struct("Psk") .field("hint", &self.hint) @@ -109,7 +109,7 @@ impl<'a> X509<'a> { } } -impl<'a> Debug for X509<'a> { +impl Debug for X509<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { f.debug_struct("X509").finish_non_exhaustive() } @@ -165,7 +165,7 @@ mod esptls { pub is_plain_tcp: bool, } - impl<'a> Config<'a> { + impl Config<'_> { pub const fn new() -> Self { Self { alpn_protos: None, @@ -265,7 +265,7 @@ mod esptls { } } - impl<'a> Default for Config<'a> { + impl Default for Config<'_> { fn default() -> Self { Self::new() } @@ -1052,7 +1052,7 @@ mod esptls { not(esp_idf_version_major = "4"), any(not(esp_idf_version_major = "5"), not(esp_idf_version_minor = "0")) ))] - impl<'a, S> futures_io::AsyncRead for &'a EspAsyncTls + impl futures_io::AsyncRead for &EspAsyncTls where S: PollableSocket, { @@ -1100,7 +1100,7 @@ mod esptls { not(esp_idf_version_major = "4"), any(not(esp_idf_version_major = "5"), not(esp_idf_version_minor = "0")) ))] - impl<'a, S> futures_io::AsyncWrite for &'a EspAsyncTls + impl futures_io::AsyncWrite for &EspAsyncTls where S: PollableSocket, { diff --git a/src/wifi.rs b/src/wifi.rs index aa16dd172cc..c2b22c5468a 100644 --- a/src/wifi.rs +++ b/src/wifi.rs @@ -1357,9 +1357,9 @@ impl<'d> WifiDriver<'d> { } } -unsafe impl<'d> Send for WifiDriver<'d> {} +unsafe impl Send for WifiDriver<'_> {} -impl<'d> NonBlocking for WifiDriver<'d> { +impl NonBlocking for WifiDriver<'_> { fn is_scan_done(&self) -> Result { WifiDriver::is_scan_done(self) } @@ -1400,7 +1400,7 @@ impl<'d> NonBlocking for WifiDriver<'d> { } } -impl<'d> Drop for WifiDriver<'d> { +impl Drop for WifiDriver<'_> { fn drop(&mut self) { self.clear_all().unwrap(); @@ -1408,7 +1408,7 @@ impl<'d> Drop for WifiDriver<'d> { } } -impl<'d> Wifi for WifiDriver<'d> { +impl Wifi for WifiDriver<'_> { type Error = EspError; fn get_capabilities(&self) -> Result, Self::Error> { @@ -1810,7 +1810,7 @@ impl<'d> EspWifi<'d> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d> Drop for EspWifi<'d> { +impl Drop for EspWifi<'_> { fn drop(&mut self) { self.detach_netif().unwrap(); @@ -1819,10 +1819,10 @@ impl<'d> Drop for EspWifi<'d> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -unsafe impl<'d> Send for EspWifi<'d> {} +unsafe impl Send for EspWifi<'_> {} #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d> NonBlocking for EspWifi<'d> { +impl NonBlocking for EspWifi<'_> { fn is_scan_done(&self) -> Result { EspWifi::is_scan_done(self) } @@ -1864,7 +1864,7 @@ impl<'d> NonBlocking for EspWifi<'d> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d> Wifi for EspWifi<'d> { +impl Wifi for EspWifi<'_> { type Error = EspError; fn get_capabilities(&self) -> Result, Self::Error> { @@ -1915,7 +1915,7 @@ impl<'d> Wifi for EspWifi<'d> { } #[cfg(esp_idf_comp_esp_netif_enabled)] -impl<'d> NetifStatus for EspWifi<'d> { +impl NetifStatus for EspWifi<'_> { fn is_up(&self) -> Result { EspWifi::is_up(self) } @@ -2260,13 +2260,13 @@ pub enum WifiEvent<'a> { HomeChannelChange(HomeChannelChange), } -unsafe impl<'a> EspEventSource for WifiEvent<'a> { +unsafe impl EspEventSource for WifiEvent<'_> { fn source() -> Option<&'static ffi::CStr> { Some(unsafe { ffi::CStr::from_ptr(WIFI_EVENT) }) } } -impl<'a> EspEventDeserializer for WifiEvent<'a> { +impl EspEventDeserializer for WifiEvent<'_> { type Data<'d> = WifiEvent<'d>; #[allow(non_upper_case_globals, non_snake_case)]