From 668f9cb0e0ea45c6d2cdc802dbe99b12f5623fff Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Fri, 2 Feb 2024 13:33:16 -0500 Subject: Rust API : Misc clippy fixes --- rust/src/relocation.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'rust/src/relocation.rs') diff --git a/rust/src/relocation.rs b/rust/src/relocation.rs index 7be7861d..f9cbb3c5 100644 --- a/rust/src/relocation.rs +++ b/rust/src/relocation.rs @@ -172,6 +172,12 @@ impl RelocationInfo { } } +impl Default for RelocationInfo { + fn default() -> Self { + Self::new() + } +} + pub struct Relocation(*mut BNRelocation); impl Relocation { @@ -430,7 +436,7 @@ where let result = unsafe { core::slice::from_raw_parts_mut(result, count) }; let mut info = result .iter() - .map(|i| RelocationInfo::from_raw(i)) + .map(RelocationInfo::from_raw) .collect::>(); let ok = custom_handler.get_relocation_info(bv.as_ref(), arch.as_ref(), info.as_mut_slice()); @@ -549,9 +555,7 @@ where R: 'static + RelocationHandler + Send + Sync, { fn clone(&self) -> Self { - Self { - handle: self.handle, - } + *self } } -- cgit v1.3.1