Reformats Code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use std::env;
|
||||
use cached::proc_macro::cached;
|
||||
use std::env;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ConfigAuth {
|
||||
@@ -8,10 +8,7 @@ pub struct ConfigAuth {
|
||||
|
||||
#[cached]
|
||||
pub fn get_config_auth() -> ConfigAuth {
|
||||
let url = env::var("AUTH_URL")
|
||||
.expect("AUTH_URL must be set");
|
||||
let url = env::var("AUTH_URL").expect("AUTH_URL must be set");
|
||||
|
||||
ConfigAuth {
|
||||
auth_url: url,
|
||||
}
|
||||
}
|
||||
ConfigAuth { auth_url: url }
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::env;
|
||||
use cached::proc_macro::cached;
|
||||
use std::env;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ConfigServer {
|
||||
@@ -9,14 +9,12 @@ pub struct ConfigServer {
|
||||
|
||||
#[cached]
|
||||
pub fn get_config_server() -> ConfigServer {
|
||||
let h = option_env!("HOST")
|
||||
.unwrap_or("localhost").to_string();
|
||||
let h = option_env!("HOST").unwrap_or("localhost").to_string();
|
||||
|
||||
let p = option_env!("PORT").unwrap_or("8500")
|
||||
.parse::<u16>().unwrap();
|
||||
let p = option_env!("PORT")
|
||||
.unwrap_or("8500")
|
||||
.parse::<u16>()
|
||||
.unwrap();
|
||||
|
||||
ConfigServer {
|
||||
host: h,
|
||||
port: p,
|
||||
}
|
||||
}
|
||||
ConfigServer { host: h, port: p }
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
pub mod config_auth;
|
||||
pub mod config_server;
|
||||
pub mod config_auth;
|
||||
Reference in New Issue
Block a user