diff options
| author | Josh Ferrell <josh@vector35.com> | 2025-10-30 13:41:51 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2025-10-30 13:41:51 -0400 |
| commit | 6fe6761631878e1a11d8c7980999f867feb5510e (patch) | |
| tree | 35cd7a42b4a886d8267621d5f629f6fdb89c59f3 /rust | |
| parent | af8a0e059aaa036af68ea4387e65822bffb83d18 (diff) | |
Fix rust api formatting
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/headless.rs | 2 | ||||
| -rw-r--r-- | rust/src/repository/manager.rs | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/rust/src/headless.rs b/rust/src/headless.rs index 40ff25b8..4690e9ac 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -26,7 +26,7 @@ use crate::enterprise::EnterpriseCheckoutStatus; use crate::main_thread::{MainThreadAction, MainThreadHandler}; use crate::progress::ProgressCallback; use crate::rc::Ref; -use binaryninjacore_sys::{BNInitPlugins}; +use binaryninjacore_sys::BNInitPlugins; use std::sync::mpsc::Sender; use std::sync::Mutex; use std::thread::JoinHandle; diff --git a/rust/src/repository/manager.rs b/rust/src/repository/manager.rs index 93d47660..d20539c4 100644 --- a/rust/src/repository/manager.rs +++ b/rust/src/repository/manager.rs @@ -1,9 +1,10 @@ use crate::rc::{Array, Ref}; use crate::repository::Repository; use crate::string::IntoCStr; -use binaryninjacore_sys::{BNRepositoryGetRepositoryByPath, - BNRepositoryManagerAddRepository, BNRepositoryManagerCheckForUpdates, - BNRepositoryManagerGetDefaultRepository, BNRepositoryManagerGetRepositories, +use binaryninjacore_sys::{ + BNRepositoryGetRepositoryByPath, BNRepositoryManagerAddRepository, + BNRepositoryManagerCheckForUpdates, BNRepositoryManagerGetDefaultRepository, + BNRepositoryManagerGetRepositories, }; use std::fmt::Debug; use std::path::Path; @@ -22,8 +23,7 @@ impl RepositoryManager { /// List of [`Repository`] objects being managed pub fn repositories() -> Array<Repository> { let mut count = 0; - let result = - unsafe { BNRepositoryManagerGetRepositories(&mut count) }; + let result = unsafe { BNRepositoryManagerGetRepositories(&mut count) }; assert!(!result.is_null()); unsafe { Array::new(result, count, ()) } } @@ -42,15 +42,12 @@ impl RepositoryManager { pub fn add_repository(url: &str, repository_path: &Path) -> bool { let url = url.to_cstr(); let repo_path = repository_path.to_cstr(); - unsafe { - BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr()) - } + unsafe { BNRepositoryManagerAddRepository(url.as_ptr(), repo_path.as_ptr()) } } pub fn repository_by_path(path: &Path) -> Option<Repository> { let path = path.to_cstr(); - let result = - unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) }; + let result = unsafe { BNRepositoryGetRepositoryByPath(path.as_ptr()) }; NonNull::new(result).map(|raw| unsafe { Repository::from_raw(raw) }) } |
