diff options
| author | KyleMiles <krm504@nyu.edu> | 2024-02-02 13:33:16 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2024-02-02 13:33:16 -0500 |
| commit | 668f9cb0e0ea45c6d2cdc802dbe99b12f5623fff (patch) | |
| tree | 35bfa06ed37d60cbc45e2a26b6cb7c432f41c7fe /rust/src/relocation.rs | |
| parent | f682ca69b356755fe6c06bcdd8f4fab73f7d2c78 (diff) | |
Rust API : Misc clippy fixes
Diffstat (limited to 'rust/src/relocation.rs')
| -rw-r--r-- | rust/src/relocation.rs | 12 |
1 files changed, 8 insertions, 4 deletions
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::<Vec<_>>(); 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<Handle = Self> + Send + Sync, { fn clone(&self) -> Self { - Self { - handle: self.handle, - } + *self } } |
