From 5fe139e02ba26f5d0026797b3a028642c2ee1fa9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 11 Feb 2019 22:20:05 +0100 Subject: [PATCH] Adapt StoreId::new() calls Signed-off-by: Matthias Beyer --- bin/core/imag-store/src/create.rs | 3 +-- bin/core/imag-store/src/delete.rs | 3 +-- bin/core/imag-store/src/get.rs | 3 +-- bin/core/imag-store/src/retrieve.rs | 3 +-- bin/core/imag-store/src/update.rs | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/bin/core/imag-store/src/create.rs b/bin/core/imag-store/src/create.rs index c6830a42..8b6cc2e2 100644 --- a/bin/core/imag-store/src/create.rs +++ b/bin/core/imag-store/src/create.rs @@ -44,8 +44,7 @@ pub fn create(rt: &Runtime) { // unwrap is safe as value is required let path = scmd.value_of("path").unwrap(); let path = PathBuf::from(path); - let store = Some(rt.store().path().clone()); - let path = StoreId::new(store, path).map_err_trace_exit_unwrap(); + let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("path = {:?}", path); diff --git a/bin/core/imag-store/src/delete.rs b/bin/core/imag-store/src/delete.rs index bc1672b4..50c73d97 100644 --- a/bin/core/imag-store/src/delete.rs +++ b/bin/core/imag-store/src/delete.rs @@ -28,8 +28,7 @@ pub fn delete(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("delete").unwrap(); let id = scmd.value_of("id").unwrap(); // safe by clap let path = PathBuf::from(id); - let store = Some(rt.store().path().clone()); - let path = StoreId::new(store, path).map_err_trace_exit_unwrap(); + let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("Deleting file at {:?}", id); let _ = rt.store() diff --git a/bin/core/imag-store/src/get.rs b/bin/core/imag-store/src/get.rs index 582e67d7..bf9a1eea 100644 --- a/bin/core/imag-store/src/get.rs +++ b/bin/core/imag-store/src/get.rs @@ -31,8 +31,7 @@ pub fn get(rt: &Runtime) { let id = scmd.value_of("id").unwrap(); // safe by clap let path = PathBuf::from(id); - let store = Some(rt.store().path().clone()); - let path = StoreId::new(store, path).map_err_trace_exit_unwrap(); + let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("path = {:?}", path); let _ = match rt.store().get(path.clone()).map_err_trace_exit_unwrap() { diff --git a/bin/core/imag-store/src/retrieve.rs b/bin/core/imag-store/src/retrieve.rs index e1fafce8..b359a3c4 100644 --- a/bin/core/imag-store/src/retrieve.rs +++ b/bin/core/imag-store/src/retrieve.rs @@ -37,8 +37,7 @@ pub fn retrieve(rt: &Runtime) { // unwrap() is safe as arg is required let id = scmd.value_of("id").unwrap(); let path = PathBuf::from(id); - let store = Some(rt.store().path().clone()); - let path = StoreId::new(store, path).map_err_trace_exit_unwrap(); + let path = StoreId::new(path).map_err_trace_exit_unwrap(); debug!("path = {:?}", path); rt.store() diff --git a/bin/core/imag-store/src/update.rs b/bin/core/imag-store/src/update.rs index cad2fd57..c2687973 100644 --- a/bin/core/imag-store/src/update.rs +++ b/bin/core/imag-store/src/update.rs @@ -31,8 +31,7 @@ pub fn update(rt: &Runtime) { let scmd = rt.cli().subcommand_matches("update").unwrap(); let id = scmd.value_of("id").unwrap(); // Safe by clap let path = PathBuf::from(id); - let store = Some(rt.store().path().clone()); - let path = StoreId::new(store, path).map_err_trace_exit_unwrap(); + let path = StoreId::new(path).map_err_trace_exit_unwrap(); let _ = rt.store() .retrieve(path)