From c9086e98503bb9a2816a2cddb12f3bd06b534940 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:03:42 +0200 Subject: [PATCH 1/3] Remove unused imports --- libimaglink/src/error.rs | 4 +--- libimaglink/src/external.rs | 3 --- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/libimaglink/src/error.rs b/libimaglink/src/error.rs index 9dd12206..bdf7ccb1 100644 --- a/libimaglink/src/error.rs +++ b/libimaglink/src/error.rs @@ -1,8 +1,6 @@ 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::fmt::{Display, Formatter}; #[derive(Clone, Copy, Debug, PartialEq)] pub enum LinkErrorKind { diff --git a/libimaglink/src/external.rs b/libimaglink/src/external.rs index 9ab05ce1..89fa3a8d 100644 --- a/libimaglink/src/external.rs +++ b/libimaglink/src/external.rs @@ -11,13 +11,11 @@ /// This helps us greatly with deduplication of URLs. /// -use std::convert::Into; use std::ops::Deref; use std::ops::DerefMut; use std::collections::BTreeMap; use libimagstore::store::Entry; -use libimagstore::store::EntryHeader; use libimagstore::store::FileLockEntry; use libimagstore::store::Store; use libimagstore::storeid::StoreId; @@ -30,7 +28,6 @@ use internal::InternalLinker; use module_path::ModuleEntryPath; use toml::Value; -use toml::Table; use url::Url; use crypto::sha1::Sha1; use crypto::digest::Digest; From c37ca59eefca4ae0c9cc466b30b16d5b8677713d Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:04:08 +0200 Subject: [PATCH 2/3] Remove unused keyword "mut" --- libimaglink/src/external.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libimaglink/src/external.rs b/libimaglink/src/external.rs index 89fa3a8d..9df53cca 100644 --- a/libimaglink/src/external.rs +++ b/libimaglink/src/external.rs @@ -231,7 +231,7 @@ impl ExternalLinker for Entry { fn remove_external_link(&mut self, store: &Store, link: Url) -> Result<()> { // get external links, remove this one, save them self.get_external_links(store) - .and_then(|mut links| { + .and_then(|links| { debug!("Removing link = '{:?}' from links = {:?}", link, links); let links = links.into_iter() .filter(|l| l.serialize() != link.serialize()) From 1f66b0f216baf83ba0f9fef6486609b388f80b90 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:04:17 +0200 Subject: [PATCH 3/3] Add lints --- libimaglink/src/lib.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libimaglink/src/lib.rs b/libimaglink/src/lib.rs index e35725e2..448bb853 100644 --- a/libimaglink/src/lib.rs +++ b/libimaglink/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 itertools; #[macro_use] extern crate log; extern crate toml;