Adapt StoreId::new() calls

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2019-02-11 22:20:05 +01:00
parent 39d638daee
commit 5fe139e02b
5 changed files with 5 additions and 10 deletions

View file

@ -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);

View file

@ -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()

View file

@ -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() {

View file

@ -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()

View file

@ -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)