Refactor imag-link to fit new store iterator interface

This commit is contained in:
Matthias Beyer 2018-04-30 19:24:05 +02:00
parent d08c27e623
commit 40a04376ed

View file

@ -54,7 +54,6 @@ extern crate libimagutil;
use std::io::Write; use std::io::Write;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::exit;
use libimagentrylink::external::ExternalLinker; use libimagentrylink::external::ExternalLinker;
use libimagentrylink::internal::InternalLinker; use libimagentrylink::internal::InternalLinker;
@ -255,12 +254,11 @@ fn unlink(rt: &Runtime) {
.map(PathBuf::from) .map(PathBuf::from)
.collect::<Vec<PathBuf>>().into_iter() // for lifetime inference .collect::<Vec<PathBuf>>().into_iter() // for lifetime inference
.map(StoreId::new_baseless) .map(StoreId::new_baseless)
.unwrap_with(|e| { trace_error(&e); exit(1) })
.into_get_iter(rt.store()) .into_get_iter(rt.store())
.unwrap_with(|e| { trace_error(&e); exit(1) }) .trace_unwrap_exit(1)
.filter_map(|e| e) .filter_map(|x| x)
.map(|mut entry| entry.unlink(rt.store())) .map(|mut entry| entry.unlink(rt.store()))
.unwrap_with(|e| { trace_error(&e); exit(1) }) .trace_unwrap_exit(1)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
} }