Skip to content

Commit 0feeaf5

Browse files
committed
Misc rust formatting
1 parent 0263957 commit 0feeaf5

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

rust/src/collaboration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use crate::string::{BnStrCompatible, BnString};
3737
// TODO: the data because they have a greater understanding of where the function is being called from.
3838

3939
/// Check whether the client has collaboration support.
40-
///
40+
///
4141
/// Call this if you intend on providing divergent behavior, as otherwise you will likely
4242
/// crash calling collaboration APIs on unsupported builds of Binary Ninja.
4343
pub fn has_collaboration_support() -> bool {

rust/src/headless.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ use thiserror::Error;
2222

2323
use crate::enterprise::release_license;
2424
use crate::main_thread::{MainThreadAction, MainThreadHandler};
25+
use crate::progress::ProgressCallback;
2526
use crate::rc::Ref;
2627
use binaryninjacore_sys::{BNInitPlugins, BNInitRepoPlugins};
2728
use std::sync::mpsc::Sender;
2829
use std::sync::Mutex;
2930
use std::thread::JoinHandle;
3031
use std::time::Duration;
31-
use crate::progress::ProgressCallback;
3232

3333
static MAIN_THREAD_HANDLE: Mutex<Option<JoinHandle<()>>> = Mutex::new(None);
3434

@@ -293,12 +293,16 @@ impl Session {
293293
/// println!("{}/{}", progress, total);
294294
/// true
295295
/// };
296-
///
296+
///
297297
/// let bv = headless_session
298298
/// .load_with_progress("cat.bndb", print_progress)
299299
/// .expect("Couldn't open `cat.bndb`");
300300
/// ```
301-
pub fn load_with_progress(&self, file_path: impl AsRef<Path>, progress: impl ProgressCallback) -> Option<Ref<binary_view::BinaryView>> {
301+
pub fn load_with_progress(
302+
&self,
303+
file_path: impl AsRef<Path>,
304+
progress: impl ProgressCallback,
305+
) -> Option<Ref<binary_view::BinaryView>> {
302306
crate::load_with_progress(file_path, progress)
303307
}
304308

@@ -333,7 +337,7 @@ impl Session {
333337
/// println!("{}/{}", progress, total);
334338
/// true
335339
/// };
336-
///
340+
///
337341
/// let settings: Ref<Metadata> =
338342
/// HashMap::from([("analysis.linearSweep.autorun", false.into())]).into();
339343
/// let headless_session = binaryninja::headless::Session::new().unwrap();
@@ -349,7 +353,12 @@ impl Session {
349353
options: Option<O>,
350354
progress: impl ProgressCallback,
351355
) -> Option<Ref<binary_view::BinaryView>> {
352-
crate::load_with_options_and_progress(file_path, update_analysis_and_wait, options, progress)
356+
crate::load_with_options_and_progress(
357+
file_path,
358+
update_analysis_and_wait,
359+
options,
360+
progress,
361+
)
353362
}
354363
}
355364

rust/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn load(file_path: impl AsRef<Path>) -> Option<Ref<BinaryView>> {
115115
}
116116

117117
/// Equivalent to [`load`] but with a progress callback.
118-
///
118+
///
119119
/// NOTE: The progress callback will _only_ be called when loading BNDBs.
120120
pub fn load_with_progress<P: ProgressCallback>(
121121
file_path: impl AsRef<Path>,

rust/tests/collaboration.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use binaryninja::binary_view::BinaryViewExt;
2-
use binaryninja::collaboration::{has_collaboration_support, NoNameChangeset, Remote, RemoteFileType, RemoteProject};
2+
use binaryninja::collaboration::{
3+
has_collaboration_support, NoNameChangeset, Remote, RemoteFileType, RemoteProject,
4+
};
35
use binaryninja::headless::Session;
46
use binaryninja::symbol::{SymbolBuilder, SymbolType};
57
use rstest::*;

0 commit comments

Comments
 (0)