summaryrefslogtreecommitdiff
path: root/rust/src
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src')
-rw-r--r--rust/src/download/instance.rs6
-rw-r--r--rust/src/logger.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/download/instance.rs b/rust/src/download/instance.rs
index 14cc55b2..7f43dc0f 100644
--- a/rust/src/download/instance.rs
+++ b/rust/src/download/instance.rs
@@ -22,7 +22,7 @@ pub trait CustomDownloadInstance: Sized {
destroyInstance: Some(cb_destroy_instance::<Self>),
performRequest: Some(cb_perform_request::<Self>),
performCustomRequest: Some(cb_perform_custom_request::<Self>),
- freeResponse: Some(cb_free_response::<Self>),
+ freeResponse: Some(cb_free_response),
};
let instance_ptr = unsafe { BNInitDownloadInstance(provider.handle, &mut callbacks) };
// TODO: If possible pass a sensible error back...
@@ -168,7 +168,7 @@ impl std::io::Write for DownloadInstanceWriter {
self.progress += buf.len() as u64;
if self
.instance
- .progress_callback(self.progress, self.total_length.unwrap_or(u64::max_value()))
+ .progress_callback(self.progress, self.total_length.unwrap_or(u64::MAX))
{
Ok(length as usize)
} else {
@@ -602,7 +602,7 @@ pub unsafe extern "C" fn cb_perform_custom_request<C: CustomDownloadInstance>(
}
}
-unsafe extern "C" fn cb_free_response<C: CustomDownloadInstance>(
+unsafe extern "C" fn cb_free_response(
_ctxt: *mut c_void,
response: *mut BNDownloadInstanceResponse,
) {
diff --git a/rust/src/logger.rs b/rust/src/logger.rs
index a4046212..2a6db188 100644
--- a/rust/src/logger.rs
+++ b/rust/src/logger.rs
@@ -96,7 +96,7 @@ impl Ref<Logger> {
/// you should use [`Ref<Logger>::init`] to initialize the `log` compatible logger.
pub fn send_log(&self, level: Level, msg: &str) {
use binaryninjacore_sys::BNLog;
- if let Ok(msg) = CString::new(format!("{}", msg)) {
+ if let Ok(msg) = CString::new(msg) {
let logger_name = self.name().to_cstr();
unsafe {
BNLog(