summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rust/src/basicblock.rs2
-rw-r--r--rust/src/binaryview.rs15
-rw-r--r--rust/src/debuginfo.rs3
-rw-r--r--rust/src/interaction.rs2
-rw-r--r--rust/src/metadata.rs2
-rw-r--r--rust/src/types.rs1
6 files changed, 11 insertions, 14 deletions
diff --git a/rust/src/basicblock.rs b/rust/src/basicblock.rs
index 571786aa..abc57a7a 100644
--- a/rust/src/basicblock.rs
+++ b/rust/src/basicblock.rs
@@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-
-
use std::fmt;
use crate::architecture::CoreArchitecture;
diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs
index bee5914a..bf9aea9b 100644
--- a/rust/src/binaryview.rs
+++ b/rust/src/binaryview.rs
@@ -18,7 +18,7 @@
//! TODO : Mirror the Python docs for this
use binaryninjacore_sys::*;
-use std::convert::{TryFrom, TryInto};
+use std::convert::TryFrom;
pub use binaryninjacore_sys::BNModificationStatus as ModificationStatus;
@@ -690,10 +690,14 @@ pub trait BinaryViewExt: BinaryViewBase {
};
}
- fn get_default_load_settings<S: BnStrCompatible>(&self, view_type_name: S, settings: &Settings) -> Result<Ref<Settings>>{
+ fn get_default_load_settings<S: BnStrCompatible>(
+ &self,
+ view_type_name: S,
+ settings: &Settings,
+ ) -> Result<Ref<Settings>> {
let view_type_name = view_type_name.into_bytes_with_nul();
- let settings_handle = unsafe {
+ let settings_handle = unsafe {
BNBinaryViewGetDefaultLoadSettings(
self.as_ref().handle,
view_type_name.as_ref().as_ptr() as *mut _,
@@ -941,8 +945,9 @@ impl BinaryView {
}
pub fn from_accessor(meta: &FileMetadata, file: &mut FileAccessor) -> Result<Ref<Self>> {
- let handle =
- unsafe { BNCreateBinaryDataViewFromFile(meta.handle, &mut file.api_object as *mut _, true) };
+ let handle = unsafe {
+ BNCreateBinaryDataViewFromFile(meta.handle, &mut file.api_object as *mut _, true)
+ };
if handle.is_null() {
return Err(());
diff --git a/rust/src/debuginfo.rs b/rust/src/debuginfo.rs
index 1f0089fe..d4c8b357 100644
--- a/rust/src/debuginfo.rs
+++ b/rust/src/debuginfo.rs
@@ -67,16 +67,13 @@
use binaryninjacore_sys::*;
use crate::{
- architecture::{Architecture, CoreArchitecture},
binaryview::BinaryView,
- callingconvention::CallingConvention,
platform::Platform,
rc::*,
string::{raw_to_string, BnStrCompatible, BnString},
types::{DataVariableAndName, NameAndType, Type},
};
-use std::mem::transmute;
use std::{hash::Hash, mem, os::raw::c_void, ptr, slice};
struct ProgressContext(Option<Box<dyn Fn(usize, usize) -> Result<(), ()>>>);
diff --git a/rust/src/interaction.rs b/rust/src/interaction.rs
index 9fe2a45b..86ec30bb 100644
--- a/rust/src/interaction.rs
+++ b/rust/src/interaction.rs
@@ -154,7 +154,7 @@ pub fn run_progress_dialog<F: Fn(Box<dyn Fn(usize, usize) -> Result<(), ()>>)>(
progress: Option<unsafe extern "C" fn(*mut c_void, usize, usize) -> bool>,
progress_ctxt: *mut c_void,
) {
- ffi_wrap!("run_progress_dialog", unsafe {
+ ffi_wrap!("run_progress_dialog", {
let context = ctxt as *mut TaskContext<F>;
let progress_fn = Box::new(move |cur: usize, max: usize| -> Result<(), ()> {
match progress {
diff --git a/rust/src/metadata.rs b/rust/src/metadata.rs
index 0945e58a..985aad14 100644
--- a/rust/src/metadata.rs
+++ b/rust/src/metadata.rs
@@ -6,8 +6,6 @@ use crate::string::{BnStrCompatible, BnString};
use binaryninjacore_sys::*;
use std::collections::HashMap;
use std::convert::TryFrom;
-use std::ffi::CStr;
-use std::ops::Index;
use std::os::raw::c_char;
use std::slice;
diff --git a/rust/src/types.rs b/rust/src/types.rs
index d74298f5..5a580a66 100644
--- a/rust/src/types.rs
+++ b/rust/src/types.rs
@@ -30,7 +30,6 @@ use std::{fmt, mem, ptr, result, slice};
use crate::architecture::{Architecture, CoreArchitecture};
use crate::binaryview::BinaryView;
use crate::callingconvention::CallingConvention;
-use crate::disassembly::InstructionTextToken;
use crate::filemetadata::FileMetadata;
use crate::string::{raw_to_string, BnStr, BnStrCompatible, BnString};