Skip to content

Commit 6eed988

Browse files
committed
Misc clippy lints
1 parent 90062c7 commit 6eed988

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

rust/src/headless.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ impl MainThreadHandler for HeadlessMainThreadSender {
255255
}
256256

257257
fn is_enterprise_product() -> bool {
258-
match crate::product().as_str() {
259-
"Binary Ninja Enterprise Client" | "Binary Ninja Ultimate" => true,
260-
_ => false,
261-
}
258+
matches!(
259+
crate::product().as_str(),
260+
"Binary Ninja Enterprise Client" | "Binary Ninja Ultimate"
261+
)
262262
}
263263

264264
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]

rust/src/project/folder.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,14 @@ impl ProjectFolder {
9393
P: ProgressCallback,
9494
{
9595
let dest_raw = dest.to_cstr();
96-
97-
let success = unsafe {
96+
unsafe {
9897
BNProjectFolderExport(
9998
self.handle.as_ptr(),
10099
dest_raw.as_ptr(),
101100
&mut progress as *mut P as *mut c_void,
102101
Some(P::cb_progress_callback),
103102
)
104-
};
105-
106-
success
103+
}
107104
}
108105
}
109106

rust/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub unsafe trait AsCStr {
191191
fn to_cstr(self) -> Self::Result;
192192
}
193193

194-
unsafe impl<'a> AsCStr for &'a CStr {
194+
unsafe impl AsCStr for &CStr {
195195
type Result = Self;
196196

197197
fn to_cstr(self) -> Self::Result {

rust/src/type_archive.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,7 @@ impl TypeArchive {
250250
/// Delete an existing type in the type archive.
251251
pub fn delete_type_by_id<S: AsCStr>(&self, id: S) -> bool {
252252
let id = id.to_cstr();
253-
let result = unsafe { BNDeleteTypeArchiveType(self.handle.as_ptr(), id.as_ptr()) };
254-
result
253+
unsafe { BNDeleteTypeArchiveType(self.handle.as_ptr(), id.as_ptr()) }
255254
}
256255

257256
/// Retrieve a stored type in the archive

0 commit comments

Comments
 (0)