From 403e840c4a030fa6e4d04a1c4b2414fa48a38e0d Mon Sep 17 00:00:00 2001 From: gwenn Date: Fri, 4 May 2018 19:05:48 +0200 Subject: [PATCH] Fix clippy warnings --- src/unlock_notify.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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()`