Do not use Connection::handle()

https://docs.rs/rusqlite/latest/rusqlite/struct.Connection.html#method.handle
```
You should not need to use this function...
```
And use `decode_result`...
This commit is contained in:
gwenn 2022-04-18 13:17:11 +02:00 committed by Thom Chiovoloni
parent 95941f6378
commit 26c444341c
2 changed files with 7 additions and 6 deletions

View File

@ -360,6 +360,12 @@ impl InnerConnection {
)), )),
} }
} }
#[inline]
#[cfg(feature = "release_memory")]
pub fn release_memory(&self) -> Result<()> {
self.decode_result(unsafe { ffi::sqlite3_db_release_memory(self.db) })
}
} }
impl Drop for InnerConnection { impl Drop for InnerConnection {

View File

@ -602,12 +602,7 @@ impl Connection {
#[inline] #[inline]
#[cfg(feature = "release_memory")] #[cfg(feature = "release_memory")]
pub fn release_memory(&self) -> Result<()> { pub fn release_memory(&self) -> Result<()> {
unsafe { self.db.borrow_mut().release_memory()
match crate::ffi::sqlite3_db_release_memory(self.handle()) {
ffi::SQLITE_OK => Ok(()),
error => Err(error_from_sqlite_code(error)),
}
}
} }
/// Convenience method to prepare and execute a single SQL statement with /// Convenience method to prepare and execute a single SQL statement with