Fix up conventions around unsafe in internal functions

This commit is contained in:
Thom Chiovoloni
2020-04-06 19:38:33 -07:00
parent c0df911946
commit 53c99f940e
7 changed files with 46 additions and 46 deletions

View File

@@ -357,11 +357,11 @@ pub fn error_from_sqlite_code(code: c_int, message: Option<String>) -> Error {
Error::SqliteFailure(ffi::Error::new(code), message)
}
pub fn error_from_handle(db: *mut ffi::sqlite3, code: c_int) -> Error {
pub unsafe fn error_from_handle(db: *mut ffi::sqlite3, code: c_int) -> Error {
let message = if db.is_null() {
None
} else {
Some(unsafe { errmsg_to_string(ffi::sqlite3_errmsg(db)) })
Some(errmsg_to_string(ffi::sqlite3_errmsg(db)))
};
error_from_sqlite_code(code, message)
}