From 40a04376ed7fb747019acb62fec83dfb46b8c541 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 30 Apr 2018 19:24:05 +0200 Subject: [PATCH] Refactor imag-link to fit new store iterator interface --- bin/core/imag-link/src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/core/imag-link/src/main.rs b/bin/core/imag-link/src/main.rs index 4dd8e0de..46ce39e9 100644 --- a/bin/core/imag-link/src/main.rs +++ b/bin/core/imag-link/src/main.rs @@ -54,7 +54,6 @@ extern crate libimagutil; use std::io::Write; use std::path::PathBuf; -use std::process::exit; use libimagentrylink::external::ExternalLinker; use libimagentrylink::internal::InternalLinker; @@ -255,12 +254,11 @@ fn unlink(rt: &Runtime) { .map(PathBuf::from) .collect::>().into_iter() // for lifetime inference .map(StoreId::new_baseless) - .unwrap_with(|e| { trace_error(&e); exit(1) }) .into_get_iter(rt.store()) - .unwrap_with(|e| { trace_error(&e); exit(1) }) - .filter_map(|e| e) + .trace_unwrap_exit(1) + .filter_map(|x| x) .map(|mut entry| entry.unlink(rt.store())) - .unwrap_with(|e| { trace_error(&e); exit(1) }) + .trace_unwrap_exit(1) .collect::>(); }