Re-formats Code and Minor Fixes
This commit is contained in:
@@ -11,10 +11,14 @@ pub struct ConfigLimits {
|
||||
pub fn get_config_limits() -> ConfigLimits {
|
||||
dotenv::dotenv().ok();
|
||||
|
||||
let max_requests = env::var("MAX_REQUESTS").unwrap_or("10".to_string())
|
||||
.parse::<u32>().unwrap();
|
||||
let expiration_time = env::var("EXPIRATION_TIME").unwrap_or("604800".to_string())
|
||||
.parse::<usize>().unwrap();
|
||||
let max_requests = env::var("MAX_REQUESTS")
|
||||
.unwrap_or("10".to_string())
|
||||
.parse::<u32>()
|
||||
.unwrap();
|
||||
let expiration_time = env::var("EXPIRATION_TIME")
|
||||
.unwrap_or("604800".to_string())
|
||||
.parse::<usize>()
|
||||
.unwrap();
|
||||
|
||||
ConfigLimits {
|
||||
max_requests,
|
||||
|
||||
@@ -19,6 +19,6 @@ pub fn get_config_redis() -> ConfigRedis {
|
||||
ConfigRedis {
|
||||
redis_url: url,
|
||||
redis_port: port.parse::<u16>().unwrap(),
|
||||
redis_password: password
|
||||
redis_password: password,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use cached::proc_macro::cached;
|
||||
use std::env;
|
||||
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ConfigServer {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
pub mod config_auth;
|
||||
pub mod config_email;
|
||||
pub mod config_server;
|
||||
pub mod config_redis;
|
||||
pub mod config_limits;
|
||||
pub mod config_redis;
|
||||
pub mod config_server;
|
||||
|
||||
Reference in New Issue
Block a user