diff --git a/imag-store/src/create.rs b/imag-store/src/create.rs index 9d90f642..9921bb05 100644 --- a/imag-store/src/create.rs +++ b/imag-store/src/create.rs @@ -32,7 +32,7 @@ pub fn create(rt: &Runtime) { let path = scmd.value_of("path").or_else(|| scmd.value_of("id")); if path.is_none() { warn!("No ID / Path provided. Exiting now"); - write!(stderr(), "No ID / Path provided. Exiting now"); + write!(stderr(), "No ID / Path provided. Exiting now").ok(); exit(1); } @@ -101,14 +101,15 @@ fn create_from_source(rt: &Runtime, matches: &ArgMatches, path: &PathBuf) -> Res debug!("Content with len = {}", content.len()); Entry::from_str(path.clone(), &content[..]) - .map(|mut new_e| { - rt.store() + .and_then(|new_e| { + let r = rt.store() .create(path.clone()) .map(|mut old_e| { *old_e.deref_mut() = new_e; }); debug!("Entry build"); + r }) .map_err(|serr| StoreError::new(StoreErrorKind::BackendError, Some(Box::new(serr)))) } @@ -144,7 +145,7 @@ fn string_from_raw_src(raw_src: &str) -> String { debug!("Read {:?} bytes", res); } else { debug!("Reading entry from file at {:?}", raw_src); - OpenOptions::new() + let _ = OpenOptions::new() .read(true) .write(false) .create(false) diff --git a/imag-store/src/delete.rs b/imag-store/src/delete.rs index 71bf0f91..5386903e 100644 --- a/imag-store/src/delete.rs +++ b/imag-store/src/delete.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - use libimagstore::storeid::build_entry_path; use libimagrt::runtime::Runtime; use libimagutil::trace::trace_error; diff --git a/imag-store/src/main.rs b/imag-store/src/main.rs index 4b5968d7..679390e3 100644 --- a/imag-store/src/main.rs +++ b/imag-store/src/main.rs @@ -1,3 +1,18 @@ +#![deny( + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_must_use, + unused_mut, + unused_qualifications, + while_true, +)] + extern crate clap; #[macro_use] extern crate log; extern crate semver; diff --git a/imag-store/src/retrieve.rs b/imag-store/src/retrieve.rs index cc43ece2..0a49b164 100644 --- a/imag-store/src/retrieve.rs +++ b/imag-store/src/retrieve.rs @@ -1,6 +1,4 @@ -use std::path::PathBuf; use std::ops::Deref; -use std::fmt::Display; use std::process::exit; use clap::ArgMatches; diff --git a/imag-store/src/update.rs b/imag-store/src/update.rs index d37da1c2..287624c5 100644 --- a/imag-store/src/update.rs +++ b/imag-store/src/update.rs @@ -1,4 +1,3 @@ -use std::path::PathBuf; use std::ops::DerefMut; use std::process::exit; diff --git a/imag-store/src/util.rs b/imag-store/src/util.rs index 61832e3a..f14d462b 100644 --- a/imag-store/src/util.rs +++ b/imag-store/src/util.rs @@ -1,16 +1,13 @@ use std::collections::BTreeMap; -use std::path::PathBuf; use std::str::Split; use clap::ArgMatches; -use semver::Version; use toml::Value; use libimagstore::store::EntryHeader; -use libimagrt::runtime::Runtime; use libimagutil::key_value_split::IntoKeyValue; -pub fn build_toml_header(matches: &ArgMatches, mut header: EntryHeader) -> EntryHeader { +pub fn build_toml_header(matches: &ArgMatches, header: EntryHeader) -> EntryHeader { debug!("Building header from cli spec"); if let Some(headerspecs) = matches.values_of("header") { let mut main = header.into();