From 9a2791d745f4a9f0307eb69b50de5629f51564cc Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 17 May 2021 18:44:59 +0300 Subject: Make rustfmt happy --- src/main.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ce654df..1b333a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ +use kittybox_micropub as micropub; +use log::{debug, error, info}; use std::env; -use log::{error,info,debug}; use surf::Url; -use kittybox_micropub as micropub; #[async_std::main] async fn main() -> Result<(), std::io::Error> { @@ -16,7 +16,7 @@ async fn main() -> Result<(), std::io::Error> { Ok(val) => { debug!("Redis connection: {}", val); redis_uri = val - }, + } Err(_) => { error!("REDIS_URI is not set, cannot find a database"); std::process::exit(1); @@ -50,7 +50,7 @@ async fn main() -> Result<(), std::io::Error> { std::process::exit(1) } } - }, + } Err(_) => { error!("AUTHORIZATION_ENDPOINT is not set, will not be able to confirm token and ID requests using IndieAuth!"); std::process::exit(1) @@ -59,7 +59,15 @@ async fn main() -> Result<(), std::io::Error> { let media_endpoint: Option = env::var("MEDIA_ENDPOINT").ok(); - let host = env::var("SERVE_AT").ok().unwrap_or_else(|| "0.0.0.0:8080".to_string()); - let app = micropub::get_app_with_redis(token_endpoint, authorization_endpoint, redis_uri, media_endpoint).await; + let host = env::var("SERVE_AT") + .ok() + .unwrap_or_else(|| "0.0.0.0:8080".to_string()); + let app = micropub::get_app_with_redis( + token_endpoint, + authorization_endpoint, + redis_uri, + media_endpoint, + ) + .await; app.listen(host).await } -- cgit 1.4.1