From 13945ab352c630a0847ed0667dc1471186f38c0e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 3 Aug 2016 11:36:40 +0200 Subject: [PATCH] Replace unwrap() with match --- imag-store/src/get.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) {