diff options
author | Melody Horn / boringcactus <melody@boringcactus.com> | 2021-06-16 12:36:47 -0600 |
---|---|---|
committer | Melody Horn / boringcactus <melody@boringcactus.com> | 2021-06-16 12:36:47 -0600 |
commit | 685b47247aad71468f190c42929ca6f0dce843fa (patch) | |
tree | 7adf64a4c00b9ca8893fab26367ec01a30e24ad9 /src/settings.rs | |
parent | 92bf14bb7cc0c10f67a9a67e7512138c15db6ec0 (diff) | |
download | tosin-685b47247aad71468f190c42929ca6f0dce843fa.tar.gz tosin-685b47247aad71468f190c42929ca6f0dce843fa.zip |
make database backends generic
Diffstat (limited to 'src/settings.rs')
-rw-r--r-- | src/settings.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/settings.rs b/src/settings.rs index 37a3395..4b140a6 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,15 +1,15 @@ -use crate::db::backend::DbBackend; +use crate::db::backend::{self, Connectable}; -pub struct Settings { +pub struct Settings<C: Connectable> { pub installed_apps: &'static [&'static crate::apps::AppConfig], - pub database: DbBackend, + pub database: C, } -impl Default for Settings { +impl Default for Settings<backend::Sqlite> { fn default() -> Self { Self { installed_apps: &[], - database: DbBackend::Sqlite { + database: backend::Sqlite { db_file: "db.sqlite3", }, } |