From e8c682fc283a69f9cec25a92455bd4034c1618b6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:46:20 +0200 Subject: [PATCH 1/4] Remove unused imports --- imag-link/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index bd8d7f21..8731fe9a 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -12,7 +12,6 @@ extern crate libimagutil; use std::process::exit; use std::ops::Deref; -use std::error::Error; use libimagrt::runtime::Runtime; use libimagstore::error::StoreError; From a7c1cc0d6fc51ec1a388165a3b478ecca7d67229 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:46:29 +0200 Subject: [PATCH 2/4] Use unused result --- imag-link/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index 8731fe9a..15802a8c 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -81,7 +81,9 @@ fn handle_internal_linking(rt: &Runtime) { println!("{: <3}: {}", i, link); i += 1; } - }); + }) + .map_err(|e| trace_error(&e)) + .ok(); }, Err(e) => { From 533e7e6da015b71f7fdf4560ac5bb188e3b1a745 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:46:39 +0200 Subject: [PATCH 3/4] Remove unused mut keywords --- imag-link/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index 15802a8c..c0ddb67f 100644 --- a/imag-link/src/main.rs +++ b/imag-link/src/main.rs @@ -95,7 +95,7 @@ fn handle_internal_linking(rt: &Runtime) { debug!("Listing ready!"); } else { let mut from = { - let mut from = get_from_entry(&rt); + let from = get_from_entry(&rt); if from.is_none() { warn!("No 'from' entry"); exit(1); @@ -104,8 +104,8 @@ fn handle_internal_linking(rt: &Runtime) { }; debug!("Link from = {:?}", from.deref()); - let mut to = { - let mut to = get_to_entries(&rt); + let to = { + let to = get_to_entries(&rt); if to.is_none() { warn!("No 'to' entry"); exit(1); From 10edc17e19231393f4cef2028ad5ec5b86a484c6 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 16 Apr 2016 22:46:46 +0200 Subject: [PATCH 4/4] Enable lints --- imag-link/src/main.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/imag-link/src/main.rs b/imag-link/src/main.rs index c0ddb67f..d71ca7d2 100644 --- a/imag-link/src/main.rs +++ b/imag-link/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, +)] + #[macro_use] extern crate log; extern crate clap; #[macro_use] extern crate semver;