diff options
| author | Mason Reed <mason@vector35.com> | 2025-05-04 20:51:33 -0400 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-05-12 17:45:24 -0400 |
| commit | 9f5491a56f6af1fa9b030f23d40150673a52aaa1 (patch) | |
| tree | fe83813d0327fd86987472986b1f05bb69b98fd5 /rust | |
| parent | f32f083c81a5034530ac33ad2bc460dd234186a5 (diff) | |
[Rust] Misc clippy lints
Diffstat (limited to 'rust')
| -rw-r--r-- | rust/src/headless.rs | 8 | ||||
| -rw-r--r-- | rust/src/project/folder.rs | 7 | ||||
| -rw-r--r-- | rust/src/string.rs | 2 | ||||
| -rw-r--r-- | rust/src/type_archive.rs | 3 |
4 files changed, 8 insertions, 12 deletions
diff --git a/rust/src/headless.rs b/rust/src/headless.rs index 7279a459..1e56321b 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -255,10 +255,10 @@ impl MainThreadHandler for HeadlessMainThreadSender { } fn is_enterprise_product() -> bool { - match crate::product().as_str() { - "Binary Ninja Enterprise Client" | "Binary Ninja Ultimate" => true, - _ => false, - } + matches!( + crate::product().as_str(), + "Binary Ninja Enterprise Client" | "Binary Ninja Ultimate" + ) } #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] diff --git a/rust/src/project/folder.rs b/rust/src/project/folder.rs index 80416197..c7ec82e4 100644 --- a/rust/src/project/folder.rs +++ b/rust/src/project/folder.rs @@ -93,17 +93,14 @@ impl ProjectFolder { P: ProgressCallback, { let dest_raw = dest.to_cstr(); - - let success = unsafe { + unsafe { BNProjectFolderExport( self.handle.as_ptr(), dest_raw.as_ptr(), &mut progress as *mut P as *mut c_void, Some(P::cb_progress_callback), ) - }; - - success + } } } diff --git a/rust/src/string.rs b/rust/src/string.rs index 5be623c1..820418d0 100644 --- a/rust/src/string.rs +++ b/rust/src/string.rs @@ -189,7 +189,7 @@ pub unsafe trait AsCStr { fn to_cstr(self) -> Self::Result; } -unsafe impl<'a> AsCStr for &'a CStr { +unsafe impl AsCStr for &CStr { type Result = Self; fn to_cstr(self) -> Self::Result { diff --git a/rust/src/type_archive.rs b/rust/src/type_archive.rs index 05929561..8d9dd670 100644 --- a/rust/src/type_archive.rs +++ b/rust/src/type_archive.rs @@ -250,8 +250,7 @@ impl TypeArchive { /// Delete an existing type in the type archive. pub fn delete_type_by_id<S: AsCStr>(&self, id: S) -> bool { let id = id.to_cstr(); - let result = unsafe { BNDeleteTypeArchiveType(self.handle.as_ptr(), id.as_ptr()) }; - result + unsafe { BNDeleteTypeArchiveType(self.handle.as_ptr(), id.as_ptr()) } } /// Retrieve a stored type in the archive |
