diff options
| author | KyleMiles <krm504@nyu.edu> | 2023-05-10 17:06:08 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2023-05-10 17:45:16 -0400 |
| commit | a0af66644235cc8300f4b443ae90da84f901569d (patch) | |
| tree | d6654f2068425d09f836baf0fd74fbae9d121e46 /rust | |
| parent | 1f776b8b1e119d5b9eda0d51ae43b790375e7b91 (diff) | |
Rust API : Minor cleanup of PR
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/binaryview.rs | 1 | ||||
| -rw-r--r-- | rust/src/lib.rs | 4 | ||||
| -rw-r--r-- | rust/src/references.rs | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs index 3f50c001..fbbe4a58 100644 --- a/rust/src/binaryview.rs +++ b/rust/src/binaryview.rs @@ -476,6 +476,7 @@ pub trait BinaryViewExt: BinaryViewBase { } } + /// You likely would also like to call [`define_user_symbol`] to bind this data variable with a name fn define_user_data_var(&self, dv: DataVariable) { unsafe { BNDefineUserDataVariable(self.as_ref().handle, dv.address, &mut dv.t.into()); diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 94e6ea40..9cbe32e9 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -235,9 +235,9 @@ pub fn open_view<F: AsRef<Path>>(filename: F) -> Result<rc::Ref<binaryview::Bina if available_view.name().as_str() == "Raw" { None } else if is_bndb { - match view.file().get_view_of_type(available_view.name()){ + match view.file().get_view_of_type(available_view.name()) { Ok(view) => Some(view), - _ => None + _ => None, } } else { // TODO : add log prints diff --git a/rust/src/references.rs b/rust/src/references.rs index e3a73013..5e878a7d 100644 --- a/rust/src/references.rs +++ b/rust/src/references.rs @@ -25,9 +25,9 @@ pub struct DataReference { impl CodeReference { pub(crate) unsafe fn new(handle: &BNReferenceSource) -> Self { - let func = ManuallyDrop::new(Function::from_raw((*handle).func)); - let arch = CoreArchitecture::from_raw((*handle).arch); - let address = (*handle).addr; + let func = ManuallyDrop::new(Function::from_raw(handle.func)); + let arch = CoreArchitecture::from_raw(handle.arch); + let address = handle.addr; Self { func, arch, |
