From a3ed5d5ef033eb3cf70351797296955b386d0151 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 9 May 2017 00:32:44 +0200 Subject: main.rs: Change port parsing `unwrap` to `expect` Using `expect` seems nicer here because it allows us to provide a more meaningful error message. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 7956797..96a3986 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,7 +73,7 @@ fn main() { }; let port: u16 = match opt_matches.opt_str("p") { - Some(p) => p.parse().unwrap(), + Some(p) => p.parse().expect("Unable to parse specified port"), None => DEFAULT_PORT, }; -- cgit v1.2.3