From 0f13fc38c0227b316eed5f569b92e4f5b1ad733a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 3 Aug 2016 11:34:58 +0200 Subject: [PATCH] Replace unwrap() with match --- imag-store/src/create.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/imag-store/src/create.rs b/imag-store/src/create.rs index e02328e0..7329df3f 100644 --- a/imag-store/src/create.rs +++ b/imag-store/src/create.rs @@ -36,11 +36,10 @@ pub fn create(rt: &Runtime) { exit(1); } - let path = build_entry_path(rt.store(), path.unwrap()); - if path.is_err() { - trace_error_exit(&path.unwrap_err(), 1); - } - let path = path.unwrap(); + let path = match build_entry_path(rt.store(), path.unwrap()) { + Err(e) => trace_error_exit(&e, 1), + Ok(p) => p, + }; debug!("path = {:?}", path); if scmd.subcommand_matches("entry").is_some() {