diff --git a/src/config.rs b/src/config.rs index be1a23f..d986b54 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,7 +20,11 @@ pub fn get_config(file_path: &str) -> Config { Err(_) => // No config file { - Config::default() + Config { + scheme: Some("http".to_string()), + port: Some(8080), + ..Config::default() + } } } } diff --git a/src/main.rs b/src/main.rs index 3107d8c..7c89209 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,11 +30,11 @@ mod portfolio; async fn main() -> io::Result<()> { let config = config::get_config("./config/config.toml"); - let addr = ("127.0.0.1", config.port.unwrap_or(8080)); + let addr = ("127.0.0.1", config.port.unwrap()); println!( "Listening to {}://{}:{}", - config.clone().scheme.unwrap_or("http".to_string()), + config.clone().scheme.unwrap(), addr.0, addr.1 );