diff --git a/src/hooks.rs b/src/hooks.rs index e92c868..da8e95a 100644 --- a/src/hooks.rs +++ b/src/hooks.rs @@ -473,10 +473,10 @@ impl InnerConnection { where F: FnMut(), { - let _ = catch_unwind(|| { + drop(catch_unwind(|| { let boxed_hook: *mut F = p_arg as *mut F; (*boxed_hook)(); - }); + })); } let free_rollback_hook = if hook.is_some() { @@ -520,7 +520,7 @@ impl InnerConnection { F: FnMut(Action, &str, &str, i64), { let action = Action::from(action_code); - let _ = catch_unwind(|| { + drop(catch_unwind(|| { let boxed_hook: *mut F = p_arg as *mut F; (*boxed_hook)( action, @@ -528,7 +528,7 @@ impl InnerConnection { expect_utf8(p_table_name, "table name"), row_id, ); - }); + })); } let free_update_hook = if hook.is_some() { diff --git a/src/trace.rs b/src/trace.rs index 1a16a2e..be1318f 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -31,7 +31,7 @@ pub unsafe fn config_log(callback: Option) -> Result<()> { let callback: fn(c_int, &str) = unsafe { mem::transmute(p_arg) }; let s = String::from_utf8_lossy(c_slice); - let _ = catch_unwind(|| callback(err, &s)); + drop(catch_unwind(|| callback(err, &s))); } let rc = match callback { @@ -75,7 +75,7 @@ impl Connection { let trace_fn: fn(&str) = mem::transmute(p_arg); let c_slice = CStr::from_ptr(z_sql).to_bytes(); let s = String::from_utf8_lossy(c_slice); - let _ = catch_unwind(|| trace_fn(&s)); + drop(catch_unwind(|| trace_fn(&s))); } let c = self.db.borrow_mut(); @@ -109,7 +109,7 @@ impl Connection { nanoseconds / NANOS_PER_SEC, (nanoseconds % NANOS_PER_SEC) as u32, ); - let _ = catch_unwind(|| profile_fn(&s, duration)); + drop(catch_unwind(|| profile_fn(&s, duration))); } let c = self.db.borrow_mut(); diff --git a/src/unlock_notify.rs b/src/unlock_notify.rs index 8bb397d..8fba6b3 100644 --- a/src/unlock_notify.rs +++ b/src/unlock_notify.rs @@ -45,7 +45,7 @@ unsafe extern "C" fn unlock_notify_cb(ap_arg: *mut *mut c_void, n_arg: c_int) { use std::slice::from_raw_parts; let args = from_raw_parts(ap_arg as *const &UnlockNotification, n_arg as usize); for un in args { - let _ = catch_unwind(std::panic::AssertUnwindSafe(|| un.fired())); + drop(catch_unwind(std::panic::AssertUnwindSafe(|| un.fired()))); } } diff --git a/src/vtab/array.rs b/src/vtab/array.rs index dadd637..43393f6 100644 --- a/src/vtab/array.rs +++ b/src/vtab/array.rs @@ -44,7 +44,7 @@ use crate::{Connection, Result}; pub(crate) const ARRAY_TYPE: *const c_char = b"rarray\0" as *const u8 as *const c_char; pub(crate) unsafe extern "C" fn free_array(p: *mut c_void) { - let _: Array = Rc::from_raw(p as *const Vec); + drop(Rc::from_raw(p as *const Vec)); } /// Array parameter / pointer diff --git a/src/vtab/mod.rs b/src/vtab/mod.rs index 77fa34b..0d91d9f 100644 --- a/src/vtab/mod.rs +++ b/src/vtab/mod.rs @@ -919,7 +919,7 @@ where let vt = vtab as *mut T; match (*vt).destroy() { Ok(_) => { - let _: Box = Box::from_raw(vt); + drop(Box::from_raw(vt)); ffi::SQLITE_OK } Err(Error::SqliteFailure(err, s)) => {