diff --git a/build.rs b/build.rs index 3de4fbb..5bc9b4b 100644 --- a/build.rs +++ b/build.rs @@ -11,9 +11,9 @@ extern crate clap; extern crate version_check; use clap::Shell; +use std::fs; use std::io::{self, Write}; use std::process::exit; -use std::fs; include!("src/app.rs"); diff --git a/src/app.rs b/src/app.rs index d7fa9e9..ec06a1f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -16,10 +16,10 @@ struct Help { } macro_rules! doc { - ($map: expr, $name: expr, $short: expr) => { + ($map:expr, $name:expr, $short:expr) => { doc!($map, $name, $short, $short) }; - ($map: expr, $name: expr, $short: expr, $long: expr) => { + ($map:expr, $name:expr, $short:expr, $long:expr) => { $map.insert( $name, Help { diff --git a/src/exec/command.rs b/src/exec/command.rs index 3aa0997..31cac83 100644 --- a/src/exec/command.rs +++ b/src/exec/command.rs @@ -6,10 +6,10 @@ // notice may not be copied, modified, or distributed except // according to those terms. -use std::process::Command; -use std::sync::{Arc, Mutex}; use std::io; use std::io::Write; +use std::process::Command; +use std::sync::{Arc, Mutex}; /// Executes a command. pub fn execute_command(mut cmd: Command, out_perm: Arc>) { diff --git a/src/exec/job.rs b/src/exec/job.rs index b85e19e..3b0fa9c 100644 --- a/src/exec/job.rs +++ b/src/exec/job.rs @@ -7,8 +7,8 @@ // according to those terms. use std::path::PathBuf; -use std::sync::{Arc, Mutex}; use std::sync::mpsc::Receiver; +use std::sync::{Arc, Mutex}; use super::CommandTemplate; diff --git a/src/exec/mod.rs b/src/exec/mod.rs index aafe2a9..8d8879b 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -8,9 +8,9 @@ // TODO: Possible optimization could avoid pushing characters on a buffer. mod command; -mod token; -mod job; mod input; +mod job; +mod token; use std::borrow::Cow; use std::path::Path; @@ -19,10 +19,10 @@ use std::sync::{Arc, Mutex}; use regex::Regex; -use self::input::{basename, dirname, remove_extension}; use self::command::execute_command; -use self::token::Token; +use self::input::{basename, dirname, remove_extension}; pub use self::job::job; +use self::token::Token; /// Represents a template that is utilized to generate command strings. /// diff --git a/src/fshelper/mod.rs b/src/fshelper/mod.rs index 5beff0c..37677e6 100644 --- a/src/fshelper/mod.rs +++ b/src/fshelper/mod.rs @@ -7,11 +7,11 @@ // according to those terms. use std::env::current_dir; -use std::path::{Path, PathBuf}; -use std::io; use std::fs; +use std::io; #[cfg(any(unix, target_os = "redox"))] use std::os::unix::fs::PermissionsExt; +use std::path::{Path, PathBuf}; pub fn path_absolute_form(path: &Path) -> io::Result { if path.is_absolute() { diff --git a/src/internal.rs b/src/internal.rs index 7b6ceeb..8d07836 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -7,16 +7,16 @@ // according to those terms. use std::ffi::OsString; -use std::process; -use std::time; use std::io::Write; use std::path::PathBuf; +use std::process; +use std::time; use exec::CommandTemplate; use lscolors::LsColors; -use regex_syntax::Parser; -use regex_syntax::hir::Hir; use regex::RegexSet; +use regex_syntax::hir::Hir; +use regex_syntax::Parser; /// Whether or not to show pub struct FileTypes { diff --git a/src/lscolors/mod.rs b/src/lscolors/mod.rs index 466c7d4..a2cb1df 100644 --- a/src/lscolors/mod.rs +++ b/src/lscolors/mod.rs @@ -6,10 +6,9 @@ // notice may not be copied, modified, or distributed except // according to those terms. -/// A parser for the `LS_COLORS` environment variable. - -use std::collections::HashMap; use ansi_term::{Colour, Style}; +/// A parser for the `LS_COLORS` environment variable. +use std::collections::HashMap; /// Maps file extensions to ANSI colors / styles. pub type ExtensionStyles = HashMap; diff --git a/src/main.rs b/src/main.rs index a57b6d5..69479c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,11 +19,11 @@ extern crate num_cpus; extern crate regex; extern crate regex_syntax; -pub mod fshelper; -pub mod lscolors; mod app; mod exec; +pub mod fshelper; mod internal; +pub mod lscolors; mod output; mod walk; diff --git a/src/output.rs b/src/output.rs index 0c2c0b6..be9304a 100644 --- a/src/output.rs +++ b/src/output.rs @@ -6,16 +6,16 @@ // notice may not be copied, modified, or distributed except // according to those terms. -use internal::{FdOptions, EXITCODE_ERROR, EXITCODE_SIGINT}; use fshelper::is_executable; +use internal::{FdOptions, EXITCODE_ERROR, EXITCODE_SIGINT}; use lscolors::LsColors; -use std::process; use std::io::{self, Write}; use std::ops::Deref; use std::path::{self, Component, Path, PathBuf}; -use std::sync::Arc; +use std::process; use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::Arc; use ansi_term; diff --git a/src/walk.rs b/src/walk.rs index adf5bcd..25630d8 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -13,17 +13,17 @@ use fshelper; use internal::{error, FdOptions, EXITCODE_SIGINT, MAX_BUFFER_LENGTH}; use output; -use std::process; use std::error::Error; use std::path::PathBuf; -use std::sync::{Arc, Mutex}; +use std::process; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::channel; +use std::sync::{Arc, Mutex}; use std::thread; use std::time; -use ignore::{self, WalkBuilder}; use ignore::overrides::OverrideBuilder; +use ignore::{self, WalkBuilder}; use regex::Regex; /// The receiver thread can either be buffering results or directly streaming to the console. diff --git a/tests/tests.rs b/tests/tests.rs index a1790a2..668eec4 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -12,10 +12,10 @@ extern crate regex; mod testenv; -use testenv::TestEnv; use regex::escape; use std::fs; use std::io::Write; +use testenv::TestEnv; static DEFAULT_DIRS: &'static [&'static str] = &["one/two/three", "one/two/three/directory_foo"];