about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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();