From 230d00f35a83f9eab6f9a34dd8b1cb8e8494ddae Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 5 Dec 2015 01:23:06 +0100 Subject: [PATCH] Remove unused imports --- src/configuration.rs | 2 -- src/module/bm/commands.rs | 4 ++-- src/module/bm/mod.rs | 10 +--------- src/module/mod.rs | 5 ++--- src/storage/backend.rs | 5 +---- src/storage/file_id.rs | 2 +- src/storage/json/parser.rs | 1 - src/storage/parser.rs | 2 +- src/ui/file.rs | 1 - 9 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/configuration.rs b/src/configuration.rs index 8a6d6e31..a26cccff 100644 --- a/src/configuration.rs +++ b/src/configuration.rs @@ -15,8 +15,6 @@ pub struct Configuration { impl Configuration { pub fn new(config: &CliConfig) -> Configuration { - use std::env::home_dir; - let rtp = rtp_path(config).or(default_path()); let mut verbose = false; diff --git a/src/module/bm/commands.rs b/src/module/bm/commands.rs index 3b7a1d35..b4674c92 100644 --- a/src/module/bm/commands.rs +++ b/src/module/bm/commands.rs @@ -6,10 +6,10 @@ use regex::Regex; use module::{CommandEnv, CommandResult, Module, ModuleError}; use module::bm::header::{build_header, get_tags_from_header}; use runtime::Runtime; -use storage::backend::{StorageBackendError, StorageBackend}; +use storage::backend::StorageBackendError; use storage::file::File; use storage::json::parser::JsonHeaderParser; -use storage::parser::{Parser, FileHeaderParser}; +use storage::parser::Parser; use ui::file::{FilePrinter, TablePrinter}; pub fn add_command(module: &Module, env: CommandEnv) -> CommandResult { diff --git a/src/module/bm/mod.rs b/src/module/bm/mod.rs index 216665ca..08502a77 100644 --- a/src/module/bm/mod.rs +++ b/src/module/bm/mod.rs @@ -3,18 +3,10 @@ mod commands; use std::fmt::{Debug, Formatter}; use std::fmt::Result as FMTResult; -use std::path::Path; -use std::result::Result; -use clap::ArgMatches; -use regex::Regex; - -use module::{CommandMap, Module, ModuleError, ModuleResult}; +use module::{CommandMap, Module, ModuleResult}; use runtime::Runtime; use self::commands::*; -use self::header::build_header; -use storage::json::parser::JsonHeaderParser; -use storage::parser::FileHeaderParser; pub struct BMModule { path: Option, diff --git a/src/module/mod.rs b/src/module/mod.rs index a0d9a467..0d8de8e0 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -2,13 +2,12 @@ use std::collections::HashMap; use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt::Result as FMTResult; -use std::path::Path; use std::result::Result; -use clap::{App, ArgMatches}; +use clap::ArgMatches; use runtime::Runtime; -use storage::backend::{StorageBackend, StorageBackendError}; +use storage::backend::StorageBackend; pub mod bm; diff --git a/src/storage/backend.rs b/src/storage/backend.rs index 9e56778d..2d28e9f1 100644 --- a/src/storage/backend.rs +++ b/src/storage/backend.rs @@ -4,7 +4,6 @@ use std::fmt::Result as FMTResult; use std::fs::File as FSFile; use std::fs::{create_dir_all, remove_file}; use std::io::{Read, Write}; -use std::path::{Path, PathBuf}; use std::vec::{Vec, IntoIter}; use glob::glob; @@ -14,7 +13,7 @@ use module::Module; use runtime::Runtime; use storage::file::File; use storage::file_id::*; -use storage::parser::{FileHeaderParser, Parser, ParserError}; +use storage::parser::{FileHeaderParser, Parser}; pub type BackendOperationResult = Result; @@ -178,8 +177,6 @@ impl StorageBackend { pub fn get_file_by_id<'a, HP>(&self, m: &'a Module, id: &FileID, p: &Parser) -> Option> where HP: FileHeaderParser { - use std::ops::Index; - debug!("Searching for file with id '{}'", id); if id.get_type() == FileIDType::NONE { diff --git a/src/storage/file_id.rs b/src/storage/file_id.rs index 7a1353ce..a95043d1 100644 --- a/src/storage/file_id.rs +++ b/src/storage/file_id.rs @@ -2,7 +2,7 @@ use std::convert::{From, Into}; use std::error::Error; use std::fmt::{Debug, Display, Formatter}; use std::fmt; -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use std::result::Result; use regex::Regex; diff --git a/src/storage/json/parser.rs b/src/storage/json/parser.rs index 942edb1b..39b6ad58 100644 --- a/src/storage/json/parser.rs +++ b/src/storage/json/parser.rs @@ -1,5 +1,4 @@ use std::collections::HashMap; -use std::io::stdout; use std::error::Error; use serde_json::{Value, from_str}; diff --git a/src/storage/parser.rs b/src/storage/parser.rs index 71617724..0f30f04b 100644 --- a/src/storage/parser.rs +++ b/src/storage/parser.rs @@ -4,7 +4,7 @@ use std::fmt; use regex::Regex; -use super::file::{FileHeaderSpec, FileHeaderData}; +use super::file::FileHeaderData; pub struct ParserError { summary: String, diff --git a/src/ui/file.rs b/src/ui/file.rs index c454eab6..625eb43e 100644 --- a/src/ui/file.rs +++ b/src/ui/file.rs @@ -1,6 +1,5 @@ use std::iter::Iterator; -use runtime::Runtime; use storage::file::File; pub trait FilePrinter {