Skip to content

Commit 5d6fcea

Browse files
authored
Switch to turbofish and dynamic error message
1 parent c809cf5 commit 5d6fcea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ fn main() -> sysexits::ExitCode {
112112
}
113113
};
114114
let is_verbose = matches.opt_present("verbose");
115-
let max_diff_hours: u32 = match matches.opt_str("duration").map(|str| str.parse()) {
115+
let max_diff_hours = match matches.opt_str("duration").map(|str| str.parse::<u32>()) {
116116
None => 3,
117117
Some(Ok(it)) => it,
118-
Some(Err(_)) => {
119-
eprintln!("Duration must be an integer value!");
118+
Some(Err(error)) => {
119+
eprintln!("Invalid duration: {error}!");
120120
return sysexits::ExitCode::Usage;
121121
}
122122
};

0 commit comments

Comments
 (0)