From 90bb0ae5aaf27c308f3d3854614204867ba0f5d4 Mon Sep 17 00:00:00 2001 From: s1341 Date: Sun, 15 Dec 2024 09:02:13 +0200 Subject: [PATCH] Fix clippy --- frida/src/device.rs | 2 +- frida/src/device_manager.rs | 4 ++-- frida/src/injector.rs | 6 +++--- frida/src/process.rs | 8 ++++---- frida/src/script.rs | 6 +++--- frida/src/session.rs | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frida/src/device.rs b/frida/src/device.rs index e7502a42..8f6933b8 100644 --- a/frida/src/device.rs +++ b/frida/src/device.rs @@ -253,7 +253,7 @@ impl<'a> Device<'a> { } } -impl<'a> Drop for Device<'a> { +impl Drop for Device<'_> { fn drop(&mut self) { unsafe { frida_sys::frida_unref(self.device_ptr as _) } } diff --git a/frida/src/device_manager.rs b/frida/src/device_manager.rs index 3261b76d..65e00aab 100644 --- a/frida/src/device_manager.rs +++ b/frida/src/device_manager.rs @@ -82,7 +82,7 @@ impl<'a> DeviceManager<'a> { return Err(Error::DeviceLookupFailed); } - return Ok(Device::from_raw(device_ptr)); + Ok(Device::from_raw(device_ptr)); } /// Returns the remote device with the specified host. @@ -141,7 +141,7 @@ impl<'a> DeviceManager<'a> { return Err(Error::DeviceLookupFailed); } - return Ok(Device::from_raw(device_ptr)); + Ok(Device::from_raw(device_ptr)); } } diff --git a/frida/src/injector.rs b/frida/src/injector.rs index 1fd7eb2a..c37a8640 100644 --- a/frida/src/injector.rs +++ b/frida/src/injector.rs @@ -44,7 +44,7 @@ impl<'a> Injector<'a> { } } -impl<'a> Default for Injector<'a> { +impl Default for Injector<'_> { fn default() -> Self { Self::new() } @@ -130,7 +130,7 @@ pub trait Inject { E: AsRef; } -impl<'a> Inject for Injector<'a> { +impl Inject for Injector<'_> { fn inject_library_file_sync( &mut self, pid: u32, @@ -228,7 +228,7 @@ impl<'a> Inject for Injector<'a> { } } -impl<'a> Inject for Device<'a> { +impl Inject for Device<'_> { fn inject_library_file_sync( &mut self, pid: u32, diff --git a/frida/src/process.rs b/frida/src/process.rs index 2b126ce4..6333de23 100644 --- a/frida/src/process.rs +++ b/frida/src/process.rs @@ -36,7 +36,7 @@ impl<'a> Process<'a> { } } -impl<'a> Drop for Process<'a> { +impl Drop for Process<'_> { fn drop(&mut self) { unsafe { frida_sys::frida_unref(self.process_ptr as _) } } @@ -59,7 +59,7 @@ pub struct SpawnOptions<'a> { phantom: PhantomData<&'a FridaSpawnOptions>, } -impl<'a> SpawnOptions<'a> { +impl SpawnOptions<'_> { pub(crate) fn from_raw(options_ptr: *mut FridaSpawnOptions) -> Self { Self { options_ptr, @@ -159,13 +159,13 @@ impl<'a> SpawnOptions<'a> { } } -impl<'a> Default for SpawnOptions<'a> { +impl Default for SpawnOptions<'_> { fn default() -> Self { Self::new() } } -impl<'a> Drop for SpawnOptions<'a> { +impl Drop for SpawnOptions<'_> { fn drop(&mut self) { unsafe { frida_sys::frida_unref(self.options_ptr as _) } } diff --git a/frida/src/script.rs b/frida/src/script.rs index 412a9f09..c2d554b1 100644 --- a/frida/src/script.rs +++ b/frida/src/script.rs @@ -152,7 +152,7 @@ pub struct Exports<'a> { phantom: PhantomData<&'a _FridaScript>, } -impl<'a> Exports<'a> { +impl Exports<'_> { fn inc_id(&mut self) -> usize { let mut counter_borrow = self.rpc_id_counter.borrow_mut(); *counter_borrow += 1; @@ -160,7 +160,7 @@ impl<'a> Exports<'a> { } } -impl<'a> Script<'a> { +impl Script<'_> { pub(crate) fn from_raw(script_ptr: *mut _FridaScript) -> Script<'a> { let rpc_counter = Rc::new(RefCell::new(0)); let handler = Rc::new(RefCell::new(CallbackHandler::new())); @@ -306,7 +306,7 @@ impl<'a> Script<'a> { } } -impl<'a> Exports<'a> { +impl Exports<'_> { /// Run exported functions from a Frida script. pub fn call(&mut self, function_name: &str, args: Option) -> Result> { let json_req: String = { diff --git a/frida/src/session.rs b/frida/src/session.rs index d74bb3cf..534be970 100644 --- a/frida/src/session.rs +++ b/frida/src/session.rs @@ -77,7 +77,7 @@ impl<'a> Session<'a> { } } -impl<'a> Drop for Session<'a> { +impl Drop for Session<'_> { fn drop(&mut self) { unsafe { frida_sys::frida_unref(self.session_ptr as _) } }