mirror of
https://github.com/isar/rusqlite.git
synced 2025-02-21 07:18:14 +08:00
clippy::let_underscore_drop
This commit is contained in:
parent
01c4be82c8
commit
48975e015f
@ -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() {
|
||||
|
@ -31,7 +31,7 @@ pub unsafe fn config_log(callback: Option<fn(c_int, &str)>) -> 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();
|
||||
|
@ -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())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<Value>);
|
||||
drop(Rc::from_raw(p as *const Vec<Value>));
|
||||
}
|
||||
|
||||
/// Array parameter / pointer
|
||||
|
@ -919,7 +919,7 @@ where
|
||||
let vt = vtab as *mut T;
|
||||
match (*vt).destroy() {
|
||||
Ok(_) => {
|
||||
let _: Box<T> = Box::from_raw(vt);
|
||||
drop(Box::from_raw(vt));
|
||||
ffi::SQLITE_OK
|
||||
}
|
||||
Err(Error::SqliteFailure(err, s)) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user