Fix clippy warnings

This commit is contained in:
gwenn 2018-05-04 19:05:48 +02:00
parent b0e22fc372
commit 403e840c4a

View File

@ -28,12 +28,11 @@ impl UnlockNotification {
self.cond.notify_one(); self.cond.notify_one();
} }
fn wait(&mut self) -> bool { fn wait(&mut self) {
let mut fired = self.mutex.lock().unwrap(); let mut fired = self.mutex.lock().unwrap();
while !*fired { while !*fired {
fired = self.cond.wait(fired).unwrap(); 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")] #[cfg(feature = "unlock_notify")]
pub fn is_locked(db: *mut ffi::sqlite3, rc: c_int) -> bool { 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::sqlite3_extended_errcode(db)
} }
== ffi::SQLITE_LOCKED_SHAREDCACHE; == ffi::SQLITE_LOCKED_SHAREDCACHE
} }
/// This function assumes that an SQLite API call (either `sqlite3_prepare_v2()` /// This function assumes that an SQLite API call (either `sqlite3_prepare_v2()`