Rewrite .map_err_trace_exit_unwrap()

Necessary because error types changed
This commit is contained in:
Matthias Beyer 2018-02-11 19:44:56 +01:00
parent 50b0ffa6ae
commit c0000b6410
2 changed files with 6 additions and 1 deletions

View file

@ -20,6 +20,7 @@ is-it-maintained-open-issues = { repository = "matthiasbeyer/imag" }
maintenance = { status = "actively-developed" }
[dependencies]
log = "0.4"
regex = "0.2"
libimagstore = { version = "0.7.0", path = "../../../lib/core/libimagstore" }

View file

@ -32,6 +32,7 @@
while_true,
)]
#[macro_use] extern crate log;
extern crate clap;
extern crate regex;
@ -70,7 +71,10 @@ fn main() {
.value_of("pattern")
.map(Regex::new)
.unwrap() // ensured by clap
.map_err_trace_exit_unwrap(1);
.unwrap_or_else(|e| {
error!("Regex building error: {:?}", e);
::std::process::exit(1)
});
let overall_count = rt
.store()