diff --git a/imag-store/src/get.rs b/imag-store/src/get.rs index 58abe3f7..3e33ac2b 100644 --- a/imag-store/src/get.rs +++ b/imag-store/src/get.rs @@ -10,11 +10,10 @@ pub fn get(rt: &Runtime) { .map(|scmd| { scmd.value_of("id") .map(|id| { - let path = build_entry_path(rt.store(), id); - if path.is_err() { - trace_error_exit(&path.unwrap_err(), 1); - } - let path = path.unwrap(); + let path = match build_entry_path(rt.store(), id) { + Err(e) => trace_error_exit(&e, 1), + Ok(p) => p, + }; debug!("path = {:?}", path); match rt.store().get(path) {