refactor: misc clippy suggestions

This commit is contained in:
Greg Heartsfield
2022-09-24 19:28:02 -05:00
parent bef7ca7e27
commit 93dfed0a87
3 changed files with 12 additions and 14 deletions
+6 -5
View File
@@ -62,13 +62,14 @@ pub fn build_pool(
thread::sleep(Duration::from_millis(500));
}
}
let manager = match settings.database.in_memory {
true => SqliteConnectionManager::memory()
let manager = if settings.database.in_memory {
SqliteConnectionManager::memory()
.with_flags(flags)
.with_init(|c| c.execute_batch(STARTUP_SQL)),
false => SqliteConnectionManager::file(&full_path)
.with_init(|c| c.execute_batch(STARTUP_SQL))
} else {
SqliteConnectionManager::file(&full_path)
.with_flags(flags)
.with_init(|c| c.execute_batch(STARTUP_SQL)),
.with_init(|c| c.execute_batch(STARTUP_SQL))
};
let pool: SqlitePool = r2d2::Pool::builder()
.test_on_check_out(true) // no noticeable performance hit