diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-01-31 14:52:41 -0500 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-01-31 14:52:41 -0500 |
commit | 2e54294861b2e34d13a8ac2b45b3b2f236af51e3 (patch) | |
tree | 158ab0c4893483a623af14cfa0f1e529b7e4953d | |
parent | a600e132ddf1a0421eb2f0893366cc17a31200a5 (diff) |
cargo fmt
-rw-r--r-- | src/main.rs | 18 | ||||
-rw-r--r-- | src/run.rs | 6 |
2 files changed, 18 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index bd48146..11ce5c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,9 +21,9 @@ use crate::config::{ ConfigStructure, JoshutoCommandMapping, JoshutoConfig, JoshutoMimetype, JoshutoPreview, JoshutoTheme, }; +use crate::context::JoshutoContext; use crate::error::{JoshutoError, JoshutoErrorKind}; use crate::run::run; -use crate::context::JoshutoContext; const PROGRAM_NAME: &str = "joshuto"; const CONFIG_FILE: &str = "joshuto.toml"; @@ -69,8 +69,10 @@ fn run_joshuto(args: Args) -> Result<(), JoshutoError> { if args.version { let version = env!("CARGO_PKG_VERSION"); println!("{}", version); - let err = JoshutoError::new(JoshutoErrorKind::EnvVarNotPresent, - "CARGO_PKG_VERSION variable not found".to_string()); + let err = JoshutoError::new( + JoshutoErrorKind::EnvVarNotPresent, + "CARGO_PKG_VERSION variable not found".to_string(), + ); return Err(err); } if let Some(p) = args.path.as_ref() { @@ -96,7 +98,13 @@ fn run_joshuto(args: Args) -> Result<(), JoshutoError> { if let Some(p) = args.last_dir { let curr_path = std::env::current_dir()?; let mut file = File::create(p)?; - file.write_all(curr_path.into_os_string().as_os_str().to_string_lossy().as_bytes())?; + file.write_all( + curr_path + .into_os_string() + .as_os_str() + .to_string_lossy() + .as_bytes(), + )?; file.write_all("\n".as_bytes())?; } @@ -107,7 +115,7 @@ fn main() { let args = Args::from_args(); match run_joshuto(args) { - Ok(_) => {}, + Ok(_) => {} Err(e) => { eprintln!("{}", e.to_string()); process::exit(1); @@ -12,7 +12,11 @@ use crate::util::input; use crate::util::load_child::LoadChild; use crate::util::to_string::ToString; -pub fn run(backend: &mut ui::TuiBackend, context: &mut JoshutoContext, keymap_t: JoshutoCommandMapping) -> std::io::Result<()> { +pub fn run( + backend: &mut ui::TuiBackend, + context: &mut JoshutoContext, + keymap_t: JoshutoCommandMapping, +) -> std::io::Result<()> { let curr_path = std::env::current_dir()?; { // Initialize an initial tab |