about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-05-14 20:07:25 +0300
committerVika <vika@fireburn.ru>2022-05-14 20:07:25 +0300
commit6c1ebd115fff3e4dcda7c051ca71ccfec90342ec (patch)
treea652e408712941cca76bc15846c8e27af94eeaa5
parenta16272f3d0f32cb39b8da39021b45625f74ac140 (diff)
downloadkittybox-6c1ebd115fff3e4dcda7c051ca71ccfec90342ec.tar.zst
chore: code cleanup in main.rs
-rw-r--r--src/main.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs
index ed8c8e7..eb70885 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -25,12 +25,11 @@ async fn main() {
             std::process::exit(1);
         }
     };
-    let token_endpoint: Url;
-    match env::var("TOKEN_ENDPOINT") {
+    let token_endpoint: Url = match env::var("TOKEN_ENDPOINT") {
         Ok(val) => {
             debug!("Token endpoint: {}", val);
             match Url::parse(&val) {
-                Ok(val) => token_endpoint = val,
+                Ok(val) => val,
                 _ => {
                     error!("Token endpoint URL cannot be parsed, aborting.");
                     std::process::exit(1)
@@ -41,13 +40,12 @@ async fn main() {
             error!("TOKEN_ENDPOINT is not set, will not be able to authorize users!");
             std::process::exit(1)
         }
-    }
-    let authorization_endpoint: Url;
-    match env::var("AUTHORIZATION_ENDPOINT") {
+    };
+    let authorization_endpoint: Url = match env::var("AUTHORIZATION_ENDPOINT") {
         Ok(val) => {
             debug!("Auth endpoint: {}", val);
             match Url::parse(&val) {
-                Ok(val) => authorization_endpoint = val,
+                Ok(val) => val,
                 _ => {
                     error!("Authorization endpoint URL cannot be parsed, aborting.");
                     std::process::exit(1)
@@ -58,7 +56,7 @@ async fn main() {
             error!("AUTHORIZATION_ENDPOINT is not set, will not be able to confirm token and ID requests using IndieAuth!");
             std::process::exit(1)
         }
-    }
+    };
 
     //let internal_token: Option<String> = env::var("KITTYBOX_INTERNAL_TOKEN").ok();