diff options
author | Teddy Wing | 2017-05-09 00:32:44 +0200 |
---|---|---|
committer | Teddy Wing | 2017-05-09 00:32:44 +0200 |
commit | a3ed5d5ef033eb3cf70351797296955b386d0151 (patch) | |
tree | 58c778f0de33326ba3fa006636f5d109145c9f37 | |
parent | 6f4109d493c810eebd6bad53eee8424c9d2078e2 (diff) | |
download | HearURL-a3ed5d5ef033eb3cf70351797296955b386d0151.tar.bz2 |
main.rs: Change port parsing `unwrap` to `expect`
Using `expect` seems nicer here because it allows us to provide a more
meaningful error message.
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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, }; |