diff --git a/libimagcounter/src/counter.rs b/libimagcounter/src/counter.rs index 18d5ca30..bea7537e 100644 --- a/libimagcounter/src/counter.rs +++ b/libimagcounter/src/counter.rs @@ -1,7 +1,4 @@ -use std::convert::From; -use std::convert::Into; use std::ops::DerefMut; -use std::ops::Deref; use toml::Value; @@ -11,8 +8,6 @@ use libimagstore::store::Store; use libimagstore::storeid::StoreIdIterator; use libimagstore::store::FileLockEntry; use libimagstore::storeid::StoreId; -use libimagstore::error::StoreError; -use libimagstore::store::Entry; use libimagstore::storeid::IntoStoreId; use module_path::ModuleEntryPath; @@ -33,7 +28,7 @@ impl<'a> Counter<'a> { debug!("Creating new counter: '{}' with value: {}", name, init); let fle = { - let mut lockentry = store.create(ModuleEntryPath::new(name.clone()).into_storeid()); + let lockentry = store.create(ModuleEntryPath::new(name.clone()).into_storeid()); if lockentry.is_err() { return Err(CE::new(CEK::StoreWriteError, Some(Box::new(lockentry.err().unwrap())))); } @@ -105,8 +100,7 @@ impl<'a> Counter<'a> { } pub fn name(&self) -> Result { - let mut header = self.fle.deref().get_header(); - header.read("counter.name") + self.fle.get_header().read("counter.name") .map_err(|e| CE::new(CEK::StoreWriteError, Some(Box::new(e)))) .and_then(|v| { match v { @@ -117,8 +111,7 @@ impl<'a> Counter<'a> { } pub fn value(&self) -> Result { - let mut header = self.fle.deref().get_header(); - header.read("counter.value") + self.fle.get_header().read("counter.value") .map_err(|e| CE::new(CEK::StoreWriteError, Some(Box::new(e)))) .and_then(|v| { match v { diff --git a/libimagcounter/src/error.rs b/libimagcounter/src/error.rs index 78d0cf46..f1c842f7 100644 --- a/libimagcounter/src/error.rs +++ b/libimagcounter/src/error.rs @@ -1,9 +1,7 @@ use std::error::Error; use std::fmt::Error as FmtError; use std::clone::Clone; -use std::fmt::{Debug, Display, Formatter}; -use std::fmt; -use std::convert::From; +use std::fmt::{Display, Formatter}; /** * Kind of error diff --git a/libimagcounter/src/lib.rs b/libimagcounter/src/lib.rs index 8b7a333a..77033170 100644 --- a/libimagcounter/src/lib.rs +++ b/libimagcounter/src/lib.rs @@ -1,3 +1,17 @@ +#![deny( + non_camel_case_types, + non_snake_case, + path_statements, + trivial_numeric_casts, + unstable_features, + unused_allocation, + unused_import_braces, + unused_imports, + unused_mut, + unused_qualifications, + while_true, +)] + extern crate toml; #[macro_use] extern crate log; #[macro_use] extern crate semver;