diff --git a/src/platform_impl/apple/appkit/view.rs b/src/platform_impl/apple/appkit/view.rs index 4e97d9867e..e8bdffa809 100644 --- a/src/platform_impl/apple/appkit/view.rs +++ b/src/platform_impl/apple/appkit/view.rs @@ -399,7 +399,7 @@ declare_class!( unsafe { &*string }.to_string() }; - let is_control = string.chars().next().map_or(false, |c| c.is_control()); + let is_control = string.chars().next().is_some_and(|c| c.is_control()); // Commit only if we have marked text. if unsafe { self.hasMarkedText() } && self.is_ime_enabled() && !is_control { diff --git a/src/platform_impl/linux/common/xkb/mod.rs b/src/platform_impl/linux/common/xkb/mod.rs index d516883f5a..028e0a733a 100644 --- a/src/platform_impl/linux/common/xkb/mod.rs +++ b/src/platform_impl/linux/common/xkb/mod.rs @@ -183,7 +183,7 @@ pub struct KeyContext<'a> { scratch_buffer: &'a mut Vec, } -impl<'a> KeyContext<'a> { +impl KeyContext<'_> { pub fn process_key_event( &mut self, keycode: u32, diff --git a/src/platform_impl/linux/x11/activation.rs b/src/platform_impl/linux/x11/activation.rs index 858ded73a5..b2eceb082c 100644 --- a/src/platform_impl/linux/x11/activation.rs +++ b/src/platform_impl/linux/x11/activation.rs @@ -165,7 +165,7 @@ fn push_display(buffer: &mut Vec, display: &impl std::fmt::Display) { buffer: &'a mut Vec, } - impl<'a> std::fmt::Write for Writer<'a> { + impl std::fmt::Write for Writer<'_> { fn write_str(&mut self, s: &str) -> std::fmt::Result { self.buffer.extend_from_slice(s.as_bytes()); Ok(()) diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 11206326df..2f186051cd 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -762,14 +762,14 @@ impl<'a> DeviceInfo<'a> { } } -impl<'a> Drop for DeviceInfo<'a> { +impl Drop for DeviceInfo<'_> { fn drop(&mut self) { assert!(!self.info.is_null()); unsafe { (self.xconn.xinput2.XIFreeDeviceInfo)(self.info as *mut _) }; } } -impl<'a> Deref for DeviceInfo<'a> { +impl Deref for DeviceInfo<'_> { type Target = [ffi::XIDeviceInfo]; fn deref(&self) -> &Self::Target { @@ -954,7 +954,7 @@ trait CookieResultExt { fn expect_then_ignore_error(self, msg: &str); } -impl<'a, E: fmt::Debug> CookieResultExt for Result, E> { +impl CookieResultExt for Result, E> { fn expect_then_ignore_error(self, msg: &str) { self.expect(msg).ignore_error() } diff --git a/src/platform_impl/linux/x11/monitor.rs b/src/platform_impl/linux/x11/monitor.rs index eaf9bef37a..f3bbc26a18 100644 --- a/src/platform_impl/linux/x11/monitor.rs +++ b/src/platform_impl/linux/x11/monitor.rs @@ -280,7 +280,7 @@ impl XConnection { let info = self .xcb_connection() .extension_information(randr::X11_EXTENSION_NAME)? - .ok_or_else(|| X11Error::MissingExtension(randr::X11_EXTENSION_NAME))?; + .ok_or(X11Error::MissingExtension(randr::X11_EXTENSION_NAME))?; // Select input data. let event_mask = diff --git a/src/platform_impl/linux/x11/util/memory.rs b/src/platform_impl/linux/x11/util/memory.rs index d32eb8cebe..4e052a758c 100644 --- a/src/platform_impl/linux/x11/util/memory.rs +++ b/src/platform_impl/linux/x11/util/memory.rs @@ -19,7 +19,7 @@ impl<'a, T> XSmartPointer<'a, T> { } } -impl<'a, T> Deref for XSmartPointer<'a, T> { +impl Deref for XSmartPointer<'_, T> { type Target = T; fn deref(&self) -> &T { @@ -27,13 +27,13 @@ impl<'a, T> Deref for XSmartPointer<'a, T> { } } -impl<'a, T> DerefMut for XSmartPointer<'a, T> { +impl DerefMut for XSmartPointer<'_, T> { fn deref_mut(&mut self) -> &mut T { unsafe { &mut *self.ptr } } } -impl<'a, T> Drop for XSmartPointer<'a, T> { +impl Drop for XSmartPointer<'_, T> { fn drop(&mut self) { unsafe { (self.xconn.xlib.XFree)(self.ptr as *mut _); diff --git a/src/platform_impl/orbital/mod.rs b/src/platform_impl/orbital/mod.rs index 593e1e5215..379a5cea15 100644 --- a/src/platform_impl/orbital/mod.rs +++ b/src/platform_impl/orbital/mod.rs @@ -125,7 +125,7 @@ impl<'a> WindowProperties<'a> { } } -impl<'a> fmt::Display for WindowProperties<'a> { +impl fmt::Display for WindowProperties<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 874ae06a8c..0b99ca6bfa 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -563,7 +563,7 @@ impl rwh_06::HasDisplayHandle for OwnedDisplayHandle { fn main_thread_id() -> u32 { static mut MAIN_THREAD_ID: u32 = 0; - /// Function pointer used in CRT initialization section to set the above static field's value. + // Function pointer used in CRT initialization section to set the above static field's value. // Mark as used so this is not removable. #[used] diff --git a/src/platform_impl/windows/window.rs b/src/platform_impl/windows/window.rs index aee882c847..ef292015c1 100644 --- a/src/platform_impl/windows/window.rs +++ b/src/platform_impl/windows/window.rs @@ -1071,7 +1071,7 @@ pub(super) struct InitData<'a> { pub window: Option, } -impl<'a> InitData<'a> { +impl InitData<'_> { unsafe fn create_window(&self, window: HWND) -> Window { // Register for touch events if applicable {