Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 committed Dec 15, 2024
1 parent 44e66e2 commit 90bb0ae
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frida/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _) }
}
Expand Down
4 changes: 2 additions & 2 deletions frida/src/device_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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));
}
}

Expand Down
6 changes: 3 additions & 3 deletions frida/src/injector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl<'a> Injector<'a> {
}
}

impl<'a> Default for Injector<'a> {
impl Default for Injector<'_> {
fn default() -> Self {
Self::new()
}
Expand Down Expand Up @@ -130,7 +130,7 @@ pub trait Inject {
E: AsRef<str>;
}

impl<'a> Inject for Injector<'a> {
impl Inject for Injector<'_> {
fn inject_library_file_sync<D, E, P>(
&mut self,
pid: u32,
Expand Down Expand Up @@ -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<D, E, P>(
&mut self,
pid: u32,
Expand Down
8 changes: 4 additions & 4 deletions frida/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _) }
}
Expand All @@ -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,
Expand Down Expand Up @@ -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 _) }
}
Expand Down
6 changes: 3 additions & 3 deletions frida/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ 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;
*counter_borrow
}
}

impl<'a> Script<'a> {
impl Script<'_> {
pub(crate) fn from_raw(script_ptr: *mut _FridaScript) -> Script<'a> {

Check failure on line 164 in frida/src/script.rs

View workflow job for this annotation

GitHub Actions / Check (x86_64)

use of undeclared lifetime name `'a`

Check failure on line 164 in frida/src/script.rs

View workflow job for this annotation

GitHub Actions / Check (x86_64)

use of undeclared lifetime name `'a`
let rpc_counter = Rc::new(RefCell::new(0));
let handler = Rc::new(RefCell::new(CallbackHandler::new()));
Expand Down Expand Up @@ -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<Value>) -> Result<Option<Value>> {
let json_req: String = {
Expand Down
2 changes: 1 addition & 1 deletion frida/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _) }
}
Expand Down

0 comments on commit 90bb0ae

Please sign in to comment.