Fix imag-ref

This commit is contained in:
Matthias Beyer 2017-08-28 14:55:33 +02:00
parent 7ff3985eaf
commit 0e6599f192

View file

@ -50,7 +50,7 @@ use ui::build_ui;
use std::path::PathBuf; use std::path::PathBuf;
use libimagentryref::reference::Ref; use libimagentryref::refstore::RefStore;
use libimagentryref::flags::RefFlags; use libimagentryref::flags::RefFlags;
use libimagerror::trace::trace_error; use libimagerror::trace::trace_error;
use libimagrt::setup::generate_runtime_setup; use libimagrt::setup::generate_runtime_setup;
@ -84,7 +84,7 @@ fn add(rt: &Runtime) {
.with_content_hashing(cmd.is_present("track-content")) .with_content_hashing(cmd.is_present("track-content"))
.with_permission_tracking(cmd.is_present("track-permissions")); .with_permission_tracking(cmd.is_present("track-permissions"));
match Ref::create(rt.store(), path, flags) { match RefStore::create(rt.store(), path, flags) {
Ok(r) => { Ok(r) => {
debug!("Reference created: {:?}", r); debug!("Reference created: {:?}", r);
info!("Ok"); info!("Ok");
@ -104,7 +104,7 @@ fn remove(rt: &Runtime) {
let yes = cmd.is_present("yes"); let yes = cmd.is_present("yes");
if yes || ask_bool(&format!("Delete Ref with hash '{}'", hash)[..], None) { if yes || ask_bool(&format!("Delete Ref with hash '{}'", hash)[..], None) {
match Ref::delete_by_hash(rt.store(), hash) { match rt.store().delete_by_hash(hash) {
Err(e) => trace_error(&e), Err(e) => trace_error(&e),
Ok(_) => info!("Ok"), Ok(_) => info!("Ok"),
} }
@ -128,7 +128,7 @@ fn list(rt: &Runtime) {
let iter = match rt.store().retrieve_for_module("ref") { let iter = match rt.store().retrieve_for_module("ref") {
Ok(iter) => iter.filter_map(|id| { Ok(iter) => iter.filter_map(|id| {
match Ref::get(rt.store(), id) { match rt.store().get(id) {
Ok(r) => Some(r), Ok(r) => Some(r),
Err(e) => { Err(e) => {
trace_error(&e); trace_error(&e);
@ -147,7 +147,7 @@ fn list(rt: &Runtime) {
.check_changed(do_check_changed) .check_changed(do_check_changed)
.check_changed_content(do_check_changed_content) .check_changed_content(do_check_changed_content)
.check_changed_permiss(do_check_changed_permiss) .check_changed_permiss(do_check_changed_permiss)
.list(iter.map(|e| e.into())) .list(iter.filter_map(Into::into))
.ok(); .ok();
} }