From c0df91194668087fc335235cb5577dbc3d0e26f2 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Tue, 7 Apr 2020 08:58:41 -0700 Subject: [PATCH] Avoid rust-analyzer bug in InnerConnection::new (#686) This is a workaround for a false error rust-analyzer gives in InnerConnection::new. I'm guessing it's because it does some weird feature stuff. It doesn't change any semantics, but makes working in `rusqlite` much nicer when using rust-analyzer. --- src/inner_connection.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/inner_connection.rs b/src/inner_connection.rs index 775d2b9..c6694ef 100644 --- a/src/inner_connection.rs +++ b/src/inner_connection.rs @@ -36,24 +36,16 @@ pub struct InnerConnection { } impl InnerConnection { - #[cfg(not(feature = "hooks"))] - #[allow(clippy::mutex_atomic)] - pub fn new(db: *mut ffi::sqlite3, owned: bool) -> InnerConnection { - InnerConnection { - db, - interrupt_lock: Arc::new(Mutex::new(db)), - owned, - } - } - - #[cfg(feature = "hooks")] #[allow(clippy::mutex_atomic)] pub fn new(db: *mut ffi::sqlite3, owned: bool) -> InnerConnection { InnerConnection { db, interrupt_lock: Arc::new(Mutex::new(db)), + #[cfg(feature = "hooks")] free_commit_hook: None, + #[cfg(feature = "hooks")] free_rollback_hook: None, + #[cfg(feature = "hooks")] free_update_hook: None, owned, }