summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-01-25 16:35:22 -0500
committerMason Reed <mason@vector35.com>2025-01-25 16:35:22 -0500
commit0feeaf5e71ec8660d40ffff2d06e39d9f4b5dd0a (patch)
tree098d5a913102021da95074bd4dd165d2dabc518e /rust/src
parent0263957dc920a10785af6874ab3040a529547d70 (diff)
Misc rust formatting
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/collaboration.rs2
-rw-r--r--rust/src/headless.rs19
-rw-r--r--rust/src/lib.rs2
3 files changed, 16 insertions, 7 deletions
diff --git a/rust/src/collaboration.rs b/rust/src/collaboration.rs
index e173afaa..c9067762 100644
--- a/rust/src/collaboration.rs
+++ b/rust/src/collaboration.rs
@@ -37,7 +37,7 @@ use crate::string::{BnStrCompatible, BnString};
// TODO: the data because they have a greater understanding of where the function is being called from.
/// Check whether the client has collaboration support.
-///
+///
/// Call this if you intend on providing divergent behavior, as otherwise you will likely
/// crash calling collaboration APIs on unsupported builds of Binary Ninja.
pub fn has_collaboration_support() -> bool {
diff --git a/rust/src/headless.rs b/rust/src/headless.rs
index 23892079..2642b2b0 100644
--- a/rust/src/headless.rs
+++ b/rust/src/headless.rs
@@ -22,13 +22,13 @@ use thiserror::Error;
use crate::enterprise::release_license;
use crate::main_thread::{MainThreadAction, MainThreadHandler};
+use crate::progress::ProgressCallback;
use crate::rc::Ref;
use binaryninjacore_sys::{BNInitPlugins, BNInitRepoPlugins};
use std::sync::mpsc::Sender;
use std::sync::Mutex;
use std::thread::JoinHandle;
use std::time::Duration;
-use crate::progress::ProgressCallback;
static MAIN_THREAD_HANDLE: Mutex<Option<JoinHandle<()>>> = Mutex::new(None);
@@ -293,12 +293,16 @@ impl Session {
/// println!("{}/{}", progress, total);
/// true
/// };
- ///
+ ///
/// let bv = headless_session
/// .load_with_progress("cat.bndb", print_progress)
/// .expect("Couldn't open `cat.bndb`");
/// ```
- pub fn load_with_progress(&self, file_path: impl AsRef<Path>, progress: impl ProgressCallback) -> Option<Ref<binary_view::BinaryView>> {
+ pub fn load_with_progress(
+ &self,
+ file_path: impl AsRef<Path>,
+ progress: impl ProgressCallback,
+ ) -> Option<Ref<binary_view::BinaryView>> {
crate::load_with_progress(file_path, progress)
}
@@ -333,7 +337,7 @@ impl Session {
/// println!("{}/{}", progress, total);
/// true
/// };
- ///
+ ///
/// let settings: Ref<Metadata> =
/// HashMap::from([("analysis.linearSweep.autorun", false.into())]).into();
/// let headless_session = binaryninja::headless::Session::new().unwrap();
@@ -349,7 +353,12 @@ impl Session {
options: Option<O>,
progress: impl ProgressCallback,
) -> Option<Ref<binary_view::BinaryView>> {
- crate::load_with_options_and_progress(file_path, update_analysis_and_wait, options, progress)
+ crate::load_with_options_and_progress(
+ file_path,
+ update_analysis_and_wait,
+ options,
+ progress,
+ )
}
}
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 711448e5..267cf840 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -115,7 +115,7 @@ pub fn load(file_path: impl AsRef<Path>) -> Option<Ref<BinaryView>> {
}
/// Equivalent to [`load`] but with a progress callback.
-///
+///
/// NOTE: The progress callback will _only_ be called when loading BNDBs.
pub fn load_with_progress<P: ProgressCallback>(
file_path: impl AsRef<Path>,