From 6c1ebd115fff3e4dcda7c051ca71ccfec90342ec Mon Sep 17 00:00:00 2001
From: Vika <vika@fireburn.ru>
Date: Sat, 14 May 2022 20:07:25 +0300
Subject: chore: code cleanup in main.rs

---
 src/main.rs | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

(limited to 'src')

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();
 
-- 
cgit 1.4.1