From bff8868354395d343161dd04a6519e225543a45b Mon Sep 17 00:00:00 2001 From: Alexis Bourget Date: Mon, 23 Nov 2020 14:39:42 +0100 Subject: [PATCH] Formatting --- src/cmd/query.rs | 9 +++++---- src/fuzzy_finder.rs | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cmd/query.rs b/src/cmd/query.rs index a0b3753..122eebd 100644 --- a/src/cmd/query.rs +++ b/src/cmd/query.rs @@ -42,15 +42,16 @@ impl Cmd for Query { let fuzzy_finder_cmd = fuzzy_finder.cmd_name(); let handle = fuzzy_finder.stdin(); for dir in matches { - writeln!(handle, "{}", dir.display_score(now)).with_context(|| format!("could not write to {}", fuzzy_finder_cmd))?; + writeln!(handle, "{}", dir.display_score(now)) + .with_context(|| format!("could not write to {}", fuzzy_finder_cmd))?; } let selection = fuzzy_finder.wait_select()?; if self.score { print!("{}", selection); } else { - let path = selection - .get(5..) - .with_context(|| format!("could not read selection from {}", fuzzy_finder_cmd))?; + let path = selection.get(5..).with_context(|| { + format!("could not read selection from {}", fuzzy_finder_cmd) + })?; print!("{}", path) } } else if self.list { diff --git a/src/fuzzy_finder.rs b/src/fuzzy_finder.rs index 9c54276..a3b81e3 100644 --- a/src/fuzzy_finder.rs +++ b/src/fuzzy_finder.rs @@ -7,7 +7,7 @@ use std::process::{Child, ChildStdin, Command, Stdio}; pub struct FuzzyFinder { child: Child, - fuzzy_finder: &'static str + fuzzy_finder: &'static str, } impl FuzzyFinder { @@ -26,7 +26,9 @@ impl FuzzyFinder { } Ok(Self { - child: command.spawn().with_context(|| format!("could not launch {}", fuzzy_finder))?, + child: command + .spawn() + .with_context(|| format!("could not launch {}", fuzzy_finder))?, fuzzy_finder, }) } @@ -48,7 +50,8 @@ impl FuzzyFinder { match output.status.code() { // normal exit - Some(0) => String::from_utf8(output.stdout).with_context(|| format!("invalid unicode in {} output", fuzzy_finder)), + Some(0) => String::from_utf8(output.stdout) + .with_context(|| format!("invalid unicode in {} output", fuzzy_finder)), // no match Some(1) => bail!("no match found"),