diff --git a/src/unlock_notify.rs b/src/unlock_notify.rs index 491815c..b11c432 100644 --- a/src/unlock_notify.rs +++ b/src/unlock_notify.rs @@ -28,12 +28,11 @@ impl UnlockNotification { self.cond.notify_one(); } - fn wait(&mut self) -> bool { + fn wait(&mut self) { let mut fired = self.mutex.lock().unwrap(); while !*fired { fired = self.cond.wait(fired).unwrap(); } - *fired } } @@ -50,10 +49,10 @@ unsafe extern "C" fn unlock_notify_cb(ap_arg: *mut *mut c_void, n_arg: c_int) { #[cfg(feature = "unlock_notify")] pub fn is_locked(db: *mut ffi::sqlite3, rc: c_int) -> bool { - return rc == ffi::SQLITE_LOCKED_SHAREDCACHE || (rc & 0xFF) == ffi::SQLITE_LOCKED && unsafe { + rc == ffi::SQLITE_LOCKED_SHAREDCACHE || (rc & 0xFF) == ffi::SQLITE_LOCKED && unsafe { ffi::sqlite3_extended_errcode(db) } - == ffi::SQLITE_LOCKED_SHAREDCACHE; + == ffi::SQLITE_LOCKED_SHAREDCACHE } /// This function assumes that an SQLite API call (either `sqlite3_prepare_v2()`