From 9cdf80f3caaf2cf67f20d273794b33481ac7d0fc Mon Sep 17 00:00:00 2001 From: gwenn Date: Sun, 13 Jun 2021 10:39:36 +0200 Subject: [PATCH] Fix InnerConnection decode_result / changes Fix #931 --- src/blob/mod.rs | 2 +- src/busy.rs | 2 +- src/inner_connection.rs | 4 ++-- src/lib.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/blob/mod.rs b/src/blob/mod.rs index cd9ad31..dee1f73 100644 --- a/src/blob/mod.rs +++ b/src/blob/mod.rs @@ -223,7 +223,7 @@ impl Connection { row_id: i64, read_only: bool, ) -> Result> { - let mut c = self.db.borrow_mut(); + let c = self.db.borrow_mut(); let mut blob = ptr::null_mut(); let db = db.as_cstring()?; let table = super::str_to_cstring(table)?; diff --git a/src/busy.rs b/src/busy.rs index e51fb08..b394d01 100644 --- a/src/busy.rs +++ b/src/busy.rs @@ -64,7 +64,7 @@ impl Connection { 0 } } - let mut c = self.db.borrow_mut(); + let c = self.db.borrow_mut(); let r = match callback { Some(f) => unsafe { ffi::sqlite3_busy_handler(c.db(), Some(busy_handler_callback), f as *mut c_void) diff --git a/src/inner_connection.rs b/src/inner_connection.rs index 11dc524..1bd641c 100644 --- a/src/inner_connection.rs +++ b/src/inner_connection.rs @@ -136,7 +136,7 @@ impl InnerConnection { } #[inline] - pub fn decode_result(&mut self, code: c_int) -> Result<()> { + pub fn decode_result(&self, code: c_int) -> Result<()> { unsafe { InnerConnection::decode_result_raw(self.db(), code) } } @@ -278,7 +278,7 @@ impl InnerConnection { } #[inline] - pub fn changes(&mut self) -> usize { + pub fn changes(&self) -> usize { unsafe { ffi::sqlite3_changes(self.db()) as usize } } diff --git a/src/lib.rs b/src/lib.rs index d16ffa8..71a4759 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -832,7 +832,7 @@ impl Connection { #[inline] fn decode_result(&self, code: c_int) -> Result<()> { - self.db.borrow_mut().decode_result(code) + self.db.borrow().decode_result(code) } /// Return the number of rows modified, inserted or deleted by the most @@ -840,7 +840,7 @@ impl Connection { /// connection. #[inline] fn changes(&self) -> usize { - self.db.borrow_mut().changes() + self.db.borrow().changes() } /// Test for auto-commit mode.