summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorTimo Kösters <timo@koesters.xyz>2022-10-05 12:45:54 +0200
committerNyaaori <+@nyaaori.cat>2022-10-10 14:02:00 +0200
commitface766e0f32481fd97a435f1ed8579d8cfc634c (patch)
tree6985fdee252323a858b6ff29b825d5b48baef61a /src/main.rs
parent8708cd3b633d88d260982563f2e2826bc8b12038 (diff)
downloadconduit-face766e0f32481fd97a435f1ed8579d8cfc634c.zip
messing with trait objects
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs
index 543b953..d5b2731 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -69,19 +69,14 @@ async fn main() {
config.warn_deprecated();
- let db = match KeyValueDatabase::load_or_create(&config).await {
- Ok(db) => db,
- Err(e) => {
- eprintln!(
- "The database couldn't be loaded or created. The following error occured: {}",
- e
- );
- std::process::exit(1);
- }
+ if let Err(e) = KeyValueDatabase::load_or_create(&config).await {
+ eprintln!(
+ "The database couldn't be loaded or created. The following error occured: {}",
+ e
+ );
+ std::process::exit(1);
};
- SERVICES.set(db).expect("this is the first and only time we initialize the SERVICE static");
-
let start = async {
run_server().await.unwrap();
};