From a2856d86719df24fc572054713e76e8aade7e43f Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 30 Dec 2015 22:46:40 +0100 Subject: [PATCH] Remove unused imports --- src/main.rs | 2 -- src/module/bm/mod.rs | 11 +---------- src/module/helpers/cli.rs | 2 -- src/module/helpers/utils.rs | 1 - src/module/mod.rs | 8 +------- src/storage/file/hash.rs | 3 +-- src/storage/file/header/spec.rs | 2 +- src/storage/file/id.rs | 3 --- src/storage/file/id_type.rs | 2 -- src/storage/file/mod.rs | 8 -------- src/storage/mod.rs | 7 +++---- src/ui/external/editor.rs | 10 ---------- 12 files changed, 7 insertions(+), 52 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3f5bca4f..6ae80f6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,8 +9,6 @@ extern crate url; extern crate config; -use std::process::exit; - pub use cli::CliConfig; pub use configuration::Configuration; pub use runtime::{ImagLogger, Runtime}; diff --git a/src/module/bm/mod.rs b/src/module/bm/mod.rs index a2b880ae..9a043089 100644 --- a/src/module/bm/mod.rs +++ b/src/module/bm/mod.rs @@ -1,20 +1,13 @@ -use std::fmt::{Debug, Display, Formatter}; -use std::rc::Rc; -use std::cell::RefCell; +use std::fmt::{Debug, Formatter}; use std::fmt; use std::ops::Deref; use std::process::exit; use clap::ArgMatches; -use regex::Regex; use runtime::Runtime; use module::Module; -use storage::Store; -use storage::file::hash::FileHash; -use storage::file::id::FileID; -use storage::file::File; use storage::parser::FileHeaderParser; use storage::parser::Parser; use storage::json::parser::JsonHeaderParser; @@ -142,8 +135,6 @@ impl<'a> BM<'a> { * Subcommand: remove */ fn command_remove(&self, matches: &ArgMatches) -> bool { - use std::process::exit; - let parser = Parser::new(JsonHeaderParser::new(None)); let filter : Box = get_file_filter_by_cli(&parser, matches, "id", "match", "tags", None); let result = self.rt diff --git a/src/module/helpers/cli.rs b/src/module/helpers/cli.rs index 7d96cef1..c9cbbce8 100644 --- a/src/module/helpers/cli.rs +++ b/src/module/helpers/cli.rs @@ -8,8 +8,6 @@ use regex::Regex; use storage::file::File; use storage::file::hash::FileHash; -use storage::file::header::data::FileHeaderData; -use storage::file::id::FileID; use storage::json::parser::JsonHeaderParser; use storage::parser::FileHeaderParser; use storage::parser::Parser; diff --git a/src/module/helpers/utils.rs b/src/module/helpers/utils.rs index a890c5fd..10566f44 100644 --- a/src/module/helpers/utils.rs +++ b/src/module/helpers/utils.rs @@ -3,7 +3,6 @@ */ pub mod cli { use clap::ArgMatches; - use regex::Regex; use runtime::Runtime; diff --git a/src/module/mod.rs b/src/module/mod.rs index 95f0b7be..24fdc9a5 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -1,13 +1,7 @@ -use std::collections::HashMap; -use std::error::Error; -use std::fmt::{Debug, Display, Formatter}; -use std::fmt::Result as FMTResult; -use std::result::Result; +use std::fmt::Debug; use clap::ArgMatches; -use runtime::Runtime; - pub mod bm; pub mod helpers; diff --git a/src/storage/file/hash.rs b/src/storage/file/hash.rs index 4b364b25..9b55ed60 100644 --- a/src/storage/file/hash.rs +++ b/src/storage/file/hash.rs @@ -1,6 +1,5 @@ use std::convert::{From, Into}; -use std::error::Error; -use std::fmt::{Debug, Display, Formatter}; +use std::fmt::{Display, Formatter}; use std::fmt; use std::hash::Hash; use uuid::Uuid; diff --git a/src/storage/file/header/spec.rs b/src/storage/file/header/spec.rs index bcec162e..885e0beb 100644 --- a/src/storage/file/header/spec.rs +++ b/src/storage/file/header/spec.rs @@ -1,4 +1,4 @@ -use std::fmt::{Debug, Display, Formatter}; +use std::fmt::{Display, Formatter}; use std::fmt; #[derive(Debug)] diff --git a/src/storage/file/id.rs b/src/storage/file/id.rs index 29a6c752..afdc3d3d 100644 --- a/src/storage/file/id.rs +++ b/src/storage/file/id.rs @@ -1,9 +1,6 @@ use std::convert::{From, Into}; -use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt; -use std::hash::Hash; -use std::path::PathBuf; use std::result::Result; use std::str::FromStr; diff --git a/src/storage/file/id_type.rs b/src/storage/file/id_type.rs index b9532262..dbb498b6 100644 --- a/src/storage/file/id_type.rs +++ b/src/storage/file/id_type.rs @@ -1,7 +1,5 @@ use std::convert::{From, Into}; -use std::error::Error; use std::str::FromStr; -use std::hash::Hash; #[derive(Debug)] #[derive(Clone)] diff --git a/src/storage/file/mod.rs b/src/storage/file/mod.rs index 733fa376..11b1e827 100644 --- a/src/storage/file/mod.rs +++ b/src/storage/file/mod.rs @@ -1,4 +1,3 @@ -use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt; @@ -9,14 +8,7 @@ pub mod id_type; pub mod header; pub mod hash; - -use module::Module; use storage::file::id::*; -use storage::file::id_type::FileIDType; -use storage::file::hash::FileHash; -use super::parser::{FileHeaderParser, Parser, ParserError}; - -use self::header::spec::*; use self::header::data::*; /** diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 8f2a3707..fdd9b43a 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -12,12 +12,11 @@ pub mod parser; pub mod json; use module::Module; -use runtime::Runtime; use storage::file::File; use storage::file::id::FileID; use storage::file::id_type::FileIDType; use storage::file::hash::FileHash; -use storage::parser::{FileHeaderParser, Parser, ParserError}; +use storage::parser::{FileHeaderParser, Parser}; use storage::file::header::data::FileHeaderData; type Cache = HashMap>>; @@ -261,7 +260,7 @@ impl Store { }) } - use glob::{glob, Paths, PatternError}; + use glob::glob; let hashstr : String = hash.into(); let globstr = format!("{}/*-{}.imag", self.storepath, hashstr); @@ -323,7 +322,7 @@ impl Store { -> Vec>> where HP: FileHeaderParser { - use glob::{glob, Paths, PatternError}; + use glob::glob; let globstr = format!("{}/{}-*.imag", self.storepath, m.name()); let mut res = vec![]; diff --git a/src/ui/external/editor.rs b/src/ui/external/editor.rs index 3daa1d40..d6030a5e 100644 --- a/src/ui/external/editor.rs +++ b/src/ui/external/editor.rs @@ -1,12 +1,3 @@ -use std::ops::Drop; - -use std::path::PathBuf; -use std::fs::File; -use std::error::Error; - -use std::fmt::{Debug, Display, Formatter}; -use std::fmt; - use runtime::Runtime; /** @@ -17,7 +8,6 @@ pub fn let_user_provide_content(rt: &Runtime) -> Option { use std::io::Read; use std::fs::File; use std::process::Command; - use std::process::Child; let filepath = "/tmp/imag-tmp.md"; let file_created = File::create(filepath)