diff options
Diffstat (limited to 'src/db')
| -rw-r--r-- | src/db/backup.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/db/backup.rs b/src/db/backup.rs index 573a4c4..9be195c 100644 --- a/src/db/backup.rs +++ b/src/db/backup.rs @@ -1,7 +1,7 @@ use std::{ ffi::{c_int, CStr, CString}, ptr::NonNull, - str::from_utf8_unchecked, + str::from_utf8, }; use libsqlite3_sys::{ @@ -125,7 +125,9 @@ impl Error { let msg = sqlite3_errmsg(handle.as_ptr()); debug_assert!(!msg.is_null()); - from_utf8_unchecked(CStr::from_ptr(msg).to_bytes()).to_owned() + from_utf8(CStr::from_ptr(msg).to_bytes()) + .expect("error messages from sqlite are always utf-8") + .to_owned() } } } |
