From ec9710f1e79605744bf6015c097b03cddacc748e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 31 Oct 2016 23:56:21 +0100 Subject: [PATCH] Rewrite external linking handler function to use less unwrap() --- imag-link/src/main.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index bfaa239d..6f686683 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -213,16 +213,14 @@ fn get_entry_by_name<'a>(rt: &'a Runtime, name: &str) -> Result trace_error_exit(&e, 1), + Ok(None) => { + warn!("Entry not found: {:?}", entry_name); + return; + }, + Ok(Some(entry)) => entry + }; if scmd.is_present("add") { debug!("Adding link to entry!");