Skip to content

Commit 6fe6761

Browse files
committed
Fix rust api formatting
1 parent af8a0e0 commit 6fe6761

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

rust/src/headless.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::enterprise::EnterpriseCheckoutStatus;
2626
use crate::main_thread::{MainThreadAction, MainThreadHandler};
2727
use crate::progress::ProgressCallback;
2828
use crate::rc::Ref;
29-
use binaryninjacore_sys::{BNInitPlugins};
29+
use binaryninjacore_sys::BNInitPlugins;
3030
use std::sync::mpsc::Sender;
3131
use std::sync::Mutex;
3232
use std::thread::JoinHandle;

rust/src/repository/manager.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use crate::rc::{Array, Ref};
22
use crate::repository::Repository;
33
use crate::string::IntoCStr;
4-
use binaryninjacore_sys::{BNRepositoryGetRepositoryByPath,
5-
BNRepositoryManagerAddRepository, BNRepositoryManagerCheckForUpdates,
6-
BNRepositoryManagerGetDefaultRepository, BNRepositoryManagerGetRepositories,
4+
use binaryninjacore_sys::{
5+
BNRepositoryGetRepositoryByPath, BNRepositoryManagerAddRepository,
6+
BNRepositoryManagerCheckForUpdates, BNRepositoryManagerGetDefaultRepository,
7+
BNRepositoryManagerGetRepositories,
78
};
89
use std::fmt::Debug;
910
use std::path::Path;
@@ -22,8 +23,7 @@ impl RepositoryManager {
2223
/// List of [`Repository`] objects being managed
2324
pub fn repositories() -> Array<Repository> {
2425
let mut count = 0;
25-
let result =
26-
unsafe { BNRepositoryManagerGetRepositories(&mut count) };
26+
let result = unsafe { BNRepositoryManagerGetRepositories(&mut count) };
2727
assert!(!result.is_null());
2828
unsafe { Array::new(result, count, ()) }
2929
}
@@ -42,15 +42,12 @@ impl RepositoryManager {
4242
pub fn add_repository(url: &str, repository_path: &Path) -> bool {
4343
let url = url.to_cstr();
4444
let repo_path = repository_path.to_cstr();
45-
unsafe {
46-
BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr())
47-
}
45+
unsafe { BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr()) }
4846
}
4947

5048
pub fn repository_by_path(path: &Path) -> Option<Repository> {
5149
let path = path.to_cstr();
52-
let result =
53-
unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) };
50+
let result = unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) };
5451
NonNull::new(result).map(|raw| unsafe { Repository::from_raw(raw) })
5552
}
5653

0 commit comments

Comments
 (0)