use OpenFlags::default to avoid maintaining explicit defaults
This commit is contained in:
committed by
Tomas Babej
parent
015e8eac25
commit
e4987ea7e0
@@ -87,11 +87,11 @@ impl SqliteStorage {
|
|||||||
|
|
||||||
// Open (or create) database
|
// Open (or create) database
|
||||||
let db_file = directory.as_ref().join("taskchampion.sqlite3");
|
let db_file = directory.as_ref().join("taskchampion.sqlite3");
|
||||||
let mut flags = OpenFlags::SQLITE_OPEN_READ_WRITE
|
let mut flags = OpenFlags::default();
|
||||||
| OpenFlags::SQLITE_OPEN_NO_MUTEX
|
// default contains SQLITE_OPEN_CREATE, so remove it if we are not to
|
||||||
| OpenFlags::SQLITE_OPEN_URI;
|
// create a DB when missing.
|
||||||
if create_if_missing {
|
if !create_if_missing {
|
||||||
flags |= OpenFlags::SQLITE_OPEN_CREATE;
|
flags.remove(OpenFlags::SQLITE_OPEN_CREATE);
|
||||||
}
|
}
|
||||||
let con = Connection::open_with_flags(db_file, flags)?;
|
let con = Connection::open_with_flags(db_file, flags)?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user