From 2ccea914dd9ff89b9446c5c208437d361e22f105 Mon Sep 17 00:00:00 2001 From: Gavin Thomas Claugus Date: Tue, 26 Jul 2016 16:34:22 -0400 Subject: [PATCH] libimagref: Deny warnings and fix denied warnings Signed-off-by: Gavin Thomas Claugus --- libimagref/src/flags.rs | 2 +- libimagref/src/lib.rs | 14 ++++++++++++++ libimagref/src/lister.rs | 1 - libimagref/src/reference.rs | 3 +-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libimagref/src/flags.rs b/libimagref/src/flags.rs index 211aee7c..00bfcf2b 100644 --- a/libimagref/src/flags.rs +++ b/libimagref/src/flags.rs @@ -32,7 +32,7 @@ impl RefFlags { } /// Alias for `RefFlags::content_hashing()` - pub fn is_often_moving(mut self, b: bool) -> RefFlags { + pub fn is_often_moving(self, b: bool) -> RefFlags { self.with_content_hashing(b) } diff --git a/libimagref/src/lib.rs b/libimagref/src/lib.rs index c6f595c2..eac8842c 100644 --- a/libimagref/src/lib.rs +++ b/libimagref/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, +)] + #[macro_use] extern crate log; extern crate crypto; extern crate itertools; diff --git a/libimagref/src/lister.rs b/libimagref/src/lister.rs index 2889ee52..979984a2 100644 --- a/libimagref/src/lister.rs +++ b/libimagref/src/lister.rs @@ -10,7 +10,6 @@ use libimagerror::trace::trace_error; use libimagstore::store::Entry; use libimagstore::store::FileLockEntry; use libimagerror::into::IntoError; -use libimagentrylist::error::ListError as LE; use libimagentrylist::error::ListErrorKind as LEK; use reference::Ref; diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs index e756aeb9..6e38aa50 100644 --- a/libimagref/src/reference.rs +++ b/libimagref/src/reference.rs @@ -6,7 +6,7 @@ use std::ops::Deref; use std::ops::DerefMut; use std::collections::BTreeMap; use std::fs::File; -use std::io::{Read, Write}; +use std::io::Read; use std::fmt::{Display, Error as FmtError, Formatter}; use std::fs::Permissions; use std::result::Result as RResult; @@ -204,7 +204,6 @@ impl<'a> Ref<'a> { /// Creates a Hash from a PathBuf by making the PathBuf absolute and then running a hash /// algorithm on it fn hash_path(pb: &PathBuf) -> Result { - use std::io::Read; use crypto::sha1::Sha1; use crypto::digest::Digest;