summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Zhao <jeff.no.zhao@gmail.com>2021-01-31 14:52:41 -0500
committerJeff Zhao <jeff.no.zhao@gmail.com>2021-01-31 14:52:41 -0500
commit2e54294861b2e34d13a8ac2b45b3b2f236af51e3 (patch)
tree158ab0c4893483a623af14cfa0f1e529b7e4953d
parenta600e132ddf1a0421eb2f0893366cc17a31200a5 (diff)
cargo fmt
-rw-r--r--src/main.rs18
-rw-r--r--src/run.rs6
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);
diff --git a/src/run.rs b/src/run.rs
index 8263ae0..ad74ff1 100644
--- a/src/run.rs
+++ b/src/run.rs
@@ -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