diff --git a/src/configuration.rs b/src/configuration.rs index 7accafb..4e6ae0f 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -40,7 +40,7 @@ impl Settings { Settings { foreground: matches.is_present("FOREGROUND"), - listen: matches.value_of("LISTEN").unwrap_or("default").to_owned(), + listen: matches.value_of("LISTEN").unwrap_or("127.0.0.1").to_owned(), plugins: matches.value_of("PLUGIN").unwrap_or("filesystem").split(",").map(|s| s.to_string()).collect(), port: FromStr::from_str(matches.value_of("PORT").unwrap_or("70")).unwrap() } diff --git a/src/main.rs b/src/main.rs index 6b52dce..01ae518 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,9 +21,9 @@ fn main() { println!("Loading plugins {:?}", settings.plugins); println!("Listening on port {}", settings.port); - let addr = format!("{}:{}", settings.listen, settings.port) - .parse::() - .unwrap(); + let addr: SocketAddr = format!("{}:{}", settings.listen, settings.port) + .parse() + .expect("Unable to parse socket addr"); let listener = TcpListener::bind(&addr).unwrap(); let server = listener