return error instead of expect()

expect() is an unwrap() with a message. use the ? macro to just return
the error from main for a cleaner output
This commit is contained in:
Damjan Georgievski 2018-07-22 17:14:01 +02:00
parent bd1429ebb6
commit b139b6113a

View file

@ -54,8 +54,7 @@ fn main() -> Result<(), std::io::Error> {
info!("Serving files from {:?}", root);
server::new(move || web::create_app(&root))
.bind(&bind_addr)
.expect(&format!("Can't listen on {} ", bind_addr))
.bind(&bind_addr)?
.start();
let _ = sys.run();