diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2019-01-31 21:40:46 -0800 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2019-01-31 21:47:53 -0800 |
commit | f1e270ea007b26132ce85cc3d000d7feb8a2770e (patch) | |
tree | 85bafbc2b172e3f11f14571cab2fbe5d973963e4 | |
parent | 01412f1944651a86b623aff2fc70741012acf3c9 (diff) |
Reformat imports
-rw-r--r-- | lib/wordexp-rs/src/lib.rs | 5 | ||||
-rw-r--r-- | src/joshuto.rs | 14 | ||||
-rw-r--r-- | src/joshuto/command.rs | 85 | ||||
-rw-r--r-- | src/joshuto/command/change_directory.rs | 4 | ||||
-rw-r--r-- | src/joshuto/command/cursor_move.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/delete_file.rs | 4 | ||||
-rw-r--r-- | src/joshuto/command/file_operation.rs | 6 | ||||
-rw-r--r-- | src/joshuto/command/new_directory.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/open_file.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/parent_directory.rs | 2 | ||||
-rw-r--r-- | src/joshuto/command/quit.rs | 4 | ||||
-rw-r--r-- | src/joshuto/command/reload_dir.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/rename_file.rs | 3 | ||||
-rw-r--r-- | src/joshuto/command/search.rs | 6 | ||||
-rw-r--r-- | src/joshuto/command/selection.rs | 6 | ||||
-rw-r--r-- | src/joshuto/command/set_mode.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/show_hidden.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/tab_operations.rs | 5 | ||||
-rw-r--r-- | src/joshuto/command/tab_switch.rs | 5 | ||||
-rw-r--r-- | src/joshuto/config.rs | 7 | ||||
-rw-r--r-- | src/joshuto/history.rs | 1 | ||||
-rw-r--r-- | src/joshuto/sort.rs | 1 | ||||
-rw-r--r-- | src/joshuto/structs.rs | 1 | ||||
-rw-r--r-- | src/joshuto/tab.rs | 6 |
24 files changed, 60 insertions, 135 deletions
diff --git a/lib/wordexp-rs/src/lib.rs b/lib/wordexp-rs/src/lib.rs index 01f91b4..0a2e1bf 100644 --- a/lib/wordexp-rs/src/lib.rs +++ b/lib/wordexp-rs/src/lib.rs @@ -1,10 +1,9 @@ extern crate libc; -use std::ffi::CStr; -use std::ffi::CString; - mod ll; +use std::ffi::{CStr, CString}; + pub const WRDE_DOOFFS: i32 = (1 << 0); pub const WRDE_APPEND: i32 = (1 << 1); pub const WRDE_NOCMD: i32 = (1 << 2); diff --git a/src/joshuto.rs b/src/joshuto.rs index efc8caf..007362e 100644 --- a/src/joshuto.rs +++ b/src/joshuto.rs @@ -1,9 +1,5 @@ extern crate ncurses; -use std; -use std::collections::HashMap; -use std::time; - pub mod config; mod command; @@ -18,11 +14,11 @@ mod ui; mod unix; mod window; -use self::command::CommandKeybind; -use self::command::JoshutoCommand; -use self::config::JoshutoMimetype; -use self::config::JoshutoPreview; -use self::config::JoshutoTheme; +use std::collections::HashMap; +use std::time; + +use self::command::{CommandKeybind, JoshutoCommand}; +use self::config::{JoshutoMimetype, JoshutoPreview, JoshutoTheme}; use self::context::JoshutoContext; lazy_static! { diff --git a/src/joshuto/command.rs b/src/joshuto/command.rs index ec12340..c298f5b 100644 --- a/src/joshuto/command.rs +++ b/src/joshuto/command.rs @@ -1,68 +1,47 @@ extern crate wordexp; -use std; -use std::collections::HashMap; -use std::fmt; -use std::path; - -use joshuto::context::JoshutoContext; -use joshuto::structs; - -mod quit; -pub use self::quit::Quit; - -mod parent_directory; -pub use self::parent_directory::ParentDirectory; - -mod open_file; -pub use self::open_file::OpenFile; -pub use self::open_file::OpenFileWith; - mod change_directory; -pub use self::change_directory::ChangeDirectory; -mod reload_dir; -pub use self::reload_dir::ReloadDirList; - mod cursor_move; -pub use self::cursor_move::CursorMove; -pub use self::cursor_move::CursorMoveEnd; -pub use self::cursor_move::CursorMoveHome; -pub use self::cursor_move::CursorMovePageDown; -pub use self::cursor_move::CursorMovePageUp; - -mod file_operation; -pub use self::file_operation::CopyFiles; -pub use self::file_operation::CutFiles; -pub use self::file_operation::PasteFiles; - mod delete_file; -pub use self::delete_file::DeleteFiles; - -mod rename_file; -pub use self::rename_file::RenameFile; -pub use self::rename_file::RenameFileMethod; - +mod file_operation; mod new_directory; -pub use self::new_directory::NewDirectory; - +mod open_file; +mod parent_directory; +mod quit; +mod reload_dir; +mod rename_file; mod search; -pub use self::search::Search; - -mod show_hidden; -pub use self::show_hidden::ToggleHiddenFiles; - mod selection; -pub use self::selection::SelectFiles; - +mod set_mode; +mod show_hidden; mod tab_operations; -pub use self::tab_operations::CloseTab; -pub use self::tab_operations::NewTab; - mod tab_switch; -pub use self::tab_switch::TabSwitch; -mod set_mode; +pub use self::change_directory::ChangeDirectory; +pub use self::cursor_move::{ + CursorMove, CursorMoveEnd, CursorMoveHome, CursorMovePageDown, CursorMovePageUp, +}; +pub use self::delete_file::DeleteFiles; +pub use self::file_operation::{CopyFiles, CutFiles, PasteFiles}; +pub use self::new_directory::NewDirectory; +pub use self::open_file::{OpenFile, OpenFileWith}; +pub use self::parent_directory::ParentDirectory; +pub use self::quit::Quit; +pub use self::reload_dir::ReloadDirList; +pub use self::rename_file::{RenameFile, RenameFileMethod}; +pub use self::search::Search; +pub use self::selection::SelectFiles; pub use self::set_mode::SetMode; +pub use self::show_hidden::ToggleHiddenFiles; +pub use self::tab_operations::{CloseTab, NewTab}; +pub use self::tab_switch::TabSwitch; + +use std::collections::HashMap; +use std::fmt; +use std::path; + +use joshuto::context::JoshutoContext; +use joshuto::structs; #[derive(Debug)] pub enum CommandKeybind { diff --git a/src/joshuto/command/change_directory.rs b/src/joshuto/command/change_directory.rs index 1d462d0..c12aa5e 100644 --- a/src/joshuto/command/change_directory.rs +++ b/src/joshuto/command/change_directory.rs @@ -1,11 +1,9 @@ extern crate ncurses; -use std; use std::path; use std::process; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::preview; use joshuto::ui; diff --git a/src/joshuto/command/cursor_move.rs b/src/joshuto/command/cursor_move.rs index 5b1f996..e38e983 100644 --- a/src/joshuto/command/cursor_move.rs +++ b/src/joshuto/command/cursor_move.rs @@ -1,9 +1,6 @@ extern crate ncurses; -use std; - -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::preview; diff --git a/src/joshuto/command/delete_file.rs b/src/joshuto/command/delete_file.rs index 2aae64b..efd6a05 100644 --- a/src/joshuto/command/delete_file.rs +++ b/src/joshuto/command/delete_file.rs @@ -3,9 +3,7 @@ extern crate ncurses; use std::fs; use std::path; -use joshuto::command; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{self, JoshutoCommand, JoshutoRunnable}; use joshuto::config::keymap; use joshuto::context::JoshutoContext; use joshuto::preview; diff --git a/src/joshuto/command/file_operation.rs b/src/joshuto/command/file_operation.rs index 2bfa76b..207cd5c 100644 --- a/src/joshuto/command/file_operation.rs +++ b/src/joshuto/command/file_operation.rs @@ -1,15 +1,11 @@ extern crate fs_extra; extern crate ncurses; -use std; use std::path; use std::sync; use std::thread; -use joshuto::command; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; -use joshuto::command::ProgressInfo; +use joshuto::command::{self, JoshutoCommand, JoshutoRunnable, ProgressInfo}; use joshuto::context::JoshutoContext; use joshuto::preview; use joshuto::structs::JoshutoDirList; diff --git a/src/joshuto/command/new_directory.rs b/src/joshuto/command/new_directory.rs index d51f5f2..fda2ef7 100644 --- a/src/joshuto/command/new_directory.rs +++ b/src/joshuto/command/new_directory.rs @@ -1,11 +1,8 @@ extern crate ncurses; -use std; use std::path; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; -use joshuto::command::ReloadDirList; +use joshuto::command::{JoshutoCommand, JoshutoRunnable, ReloadDirList}; use joshuto::context::JoshutoContext; use joshuto::textfield::JoshutoTextField; use joshuto::ui; diff --git a/src/joshuto/command/open_file.rs b/src/joshuto/command/open_file.rs index 86f0cf0..05c6255 100644 --- a/src/joshuto/command/open_file.rs +++ b/src/joshuto/command/open_file.rs @@ -2,13 +2,10 @@ extern crate fs_extra; extern crate ncurses; extern crate open; -use std; use std::env; use std::path; -use joshuto::command; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{self, JoshutoCommand, JoshutoRunnable}; use joshuto::config::mimetype; use joshuto::context::JoshutoContext; use joshuto::preview; diff --git a/src/joshuto/command/parent_directory.rs b/src/joshuto/command/parent_directory.rs index 8faa93a..ba5ae47 100644 --- a/src/joshuto/command/parent_directory.rs +++ b/src/joshuto/command/parent_directory.rs @@ -1,7 +1,5 @@ extern crate ncurses; -use std; - use joshuto::command::JoshutoRunnable; use joshuto::context::JoshutoContext; use joshuto::preview; diff --git a/src/joshuto/command/quit.rs b/src/joshuto/command/quit.rs index c774c21..48c7b35 100644 --- a/src/joshuto/command/quit.rs +++ b/src/joshuto/command/quit.rs @@ -1,8 +1,6 @@ -use std; use std::process; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::ui; diff --git a/src/joshuto/command/reload_dir.rs b/src/joshuto/command/reload_dir.rs index 010cf18..c7ce161 100644 --- a/src/joshuto/command/reload_dir.rs +++ b/src/joshuto/command/reload_dir.rs @@ -1,9 +1,6 @@ extern crate ncurses; -use std; - -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::preview; diff --git a/src/joshuto/command/rename_file.rs b/src/joshuto/command/rename_file.rs index 22a2167..f974a3e 100644 --- a/src/joshuto/command/rename_file.rs +++ b/src/joshuto/command/rename_file.rs @@ -3,8 +3,7 @@ extern crate ncurses; use std::fs; use std::path; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::preview; use joshuto::textfield::JoshutoTextField; diff --git a/src/joshuto/command/search.rs b/src/joshuto/command/search.rs index db3eed5..cb9fcbc 100644 --- a/src/joshuto/command/search.rs +++ b/src/joshuto/command/search.rs @@ -1,10 +1,6 @@ extern crate ncurses; -use std; - -use joshuto::command::CursorMove; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{CursorMove, JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::textfield::JoshutoTextField; use joshuto::ui; diff --git a/src/joshuto/command/selection.rs b/src/joshuto/command/selection.rs index be7e208..0d24d43 100644 --- a/src/joshuto/command/selection.rs +++ b/src/joshuto/command/selection.rs @@ -1,8 +1,4 @@ -use std; - -use joshuto::command::CursorMove; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{CursorMove, JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; #[derive(Debug, Clone)] diff --git a/src/joshuto/command/set_mode.rs b/src/joshuto/command/set_mode.rs index f18feba..46b4652 100644 --- a/src/joshuto/command/set_mode.rs +++ b/src/joshuto/command/set_mode.rs @@ -1,9 +1,6 @@ extern crate ncurses; -use std; - -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::structs::JoshutoDirEntry; use joshuto::textfield::JoshutoTextField; diff --git a/src/joshuto/command/show_hidden.rs b/src/joshuto/command/show_hidden.rs index 90e2a26..9bbebba 100644 --- a/src/joshuto/command/show_hidden.rs +++ b/src/joshuto/command/show_hidden.rs @@ -1,9 +1,6 @@ extern crate ncurses; -use std; - -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; #[derive(Clone, Debug)] diff --git a/src/joshuto/command/tab_operations.rs b/src/joshuto/command/tab_operations.rs index c3d1433..7bc36f7 100644 --- a/src/joshuto/command/tab_operations.rs +++ b/src/joshuto/command/tab_operations.rs @@ -1,10 +1,7 @@ -use std; use std::env; use std::path; -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; -use joshuto::command::TabSwitch; +use joshuto::command::{JoshutoCommand, JoshutoRunnable, TabSwitch}; use joshuto::context::JoshutoContext; use joshuto::tab::JoshutoTab; use joshuto::ui; diff --git a/src/joshuto/command/tab_switch.rs b/src/joshuto/command/tab_switch.rs index b1526c4..66800fa 100644 --- a/src/joshuto/command/tab_switch.rs +++ b/src/joshuto/command/tab_switch.rs @@ -1,7 +1,4 @@ -use std; - -use joshuto::command::JoshutoCommand; -use joshuto::command::JoshutoRunnable; +use joshuto::command::{JoshutoCommand, JoshutoRunnable}; use joshuto::context::JoshutoContext; use joshuto::ui; diff --git a/src/joshuto/config.rs b/src/joshuto/config.rs index 29a0c39..19c2132 100644 --- a/src/joshuto/config.rs +++ b/src/joshuto/config.rs @@ -1,7 +1,5 @@ extern crate serde; -use self::serde::de::DeserializeOwned; - pub mod config; pub mod keymap; pub mod mimetype; @@ -12,8 +10,9 @@ pub use self::config::JoshutoConfig; pub use self::keymap::JoshutoKeymap; pub use self::mimetype::JoshutoMimetype; pub use self::preview::JoshutoPreview; -pub use self::theme::JoshutoColorTheme; -pub use self::theme::JoshutoTheme; +pub use self::theme::{JoshutoColorTheme, JoshutoTheme}; + +use self::serde::de::DeserializeOwned; pub fn search_config_hierarchy(filename: &str) -> Option<std::path::PathBuf> { for path in ::CONFIG_HIERARCHY.iter() { diff --git a/src/joshuto/history.rs b/src/joshuto/history.rs index c54193f..3da6f50 100644 --- a/src/joshuto/history.rs +++ b/src/joshuto/history.rs @@ -1,4 +1,3 @@ -use std; use std::collections::HashMap; use std::path; diff --git a/src/joshuto/sort.rs b/src/joshuto/sort.rs index bfd6385..f6b92d6 100644 --- a/src/joshuto/sort.rs +++ b/src/joshuto/sort.rs @@ -1,4 +1,3 @@ -use std; use std::cmp; use std::fs; use std::time; diff --git a/src/joshuto/structs.rs b/src/joshuto/structs.rs index cd3a0e5..18ff67b 100644 --- a/src/joshuto/structs.rs +++ b/src/joshuto/structs.rs @@ -1,4 +1,3 @@ -use std; use std::ffi; use std::fs; use std::path; diff --git a/src/joshuto/tab.rs b/src/joshuto/tab.rs index f2400b9..b734528 100644 --- a/src/joshuto/tab.rs +++ b/src/joshuto/tab.rs @@ -1,11 +1,11 @@ +use std::path; + use joshuto::config; use joshuto::history; use joshuto::sort; use joshuto::structs::JoshutoDirList; use joshuto::ui; -use joshuto::window::JoshutoPanel; -use joshuto::window::JoshutoView; -use std::path; +use joshuto::window::{JoshutoPanel, JoshutoView}; use joshuto::theme_t; |