mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 16:29:20 +08:00
Fix nightly non_fmt_panic warning
This commit is contained in:
parent
2c64275371
commit
bd736b2634
@ -424,18 +424,14 @@ fn ensure_safe_sqlite_threading_mode() -> Result<()> {
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let msg = "\
|
||||
Could not ensure safe initialization of SQLite.
|
||||
To fix this, either:
|
||||
* Upgrade SQLite to at least version 3.7.0
|
||||
* Ensure that SQLite has been initialized in Multi-thread or Serialized mode and call
|
||||
rusqlite::bypass_sqlite_initialization() prior to your first connection attempt.";
|
||||
|
||||
if ffi::sqlite3_config(ffi::SQLITE_CONFIG_MULTITHREAD) != ffi::SQLITE_OK {
|
||||
panic!(msg);
|
||||
}
|
||||
if ffi::sqlite3_initialize() != ffi::SQLITE_OK {
|
||||
panic!(msg);
|
||||
if ffi::sqlite3_config(ffi::SQLITE_CONFIG_MULTITHREAD) != ffi::SQLITE_OK || ffi::sqlite3_initialize() != ffi::SQLITE_OK {
|
||||
panic!(
|
||||
"Could not ensure safe initialization of SQLite.\n\
|
||||
To fix this, either:\n\
|
||||
* Upgrade SQLite to at least version 3.7.0\n\
|
||||
* Ensure that SQLite has been initialized in Multi-thread or Serialized mode and call\n\
|
||||
rusqlite::bypass_sqlite_initialization() prior to your first connection attempt."
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user