Skip to content

Commit bd2d120

Browse files
committed
Print a better error message on invalid listen
Part of getting rid of unwraps.
1 parent 757c7f1 commit bd2d120

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rustygeard/src/main.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ fn main() -> ExitCode {
7575
.expect("default_value should ensure this");
7676
env_logger::init();
7777

78-
info!("Binding to {}", listen);
79-
let address = listen.parse().unwrap();
78+
info!("Will listen at {}", listen);
79+
let address = listen
80+
.parse()
81+
.expect("Anything passed to listen must parse into a SocketAddr");
8082
#[cfg(feature = "tls")]
8183
let tls = match matches.get_flag("tls") {
8284
false => None,

0 commit comments

Comments
 (0)