diff options
Diffstat (limited to 'src/db')
| -rw-r--r-- | src/db/backup.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/db/backup.rs b/src/db/backup.rs index 9be195c..027c233 100644 --- a/src/db/backup.rs +++ b/src/db/backup.rs @@ -121,13 +121,10 @@ impl Error { } fn message_for(handle: NonNull<sqlite3>) -> String { - unsafe { - let msg = sqlite3_errmsg(handle.as_ptr()); - debug_assert!(!msg.is_null()); - - from_utf8(CStr::from_ptr(msg).to_bytes()) - .expect("error messages from sqlite are always utf-8") - .to_owned() - } + let msg = unsafe { sqlite3_errmsg(handle.as_ptr()) }; + debug_assert!(!msg.is_null()); + from_utf8(unsafe { CStr::from_ptr(msg) }.to_bytes()) + .expect("error messages from sqlite are always utf-8") + .to_owned() } } |
