mirror of
https://github.com/sharkdp/fd.git
synced 2026-09-01 15:12:46 +08:00
style: simplify string formatting for readability
This commit is contained in:
@@ -104,9 +104,9 @@ fn format_output_error(args: &[&str], expected: &str, actual: &str) -> String {
|
||||
let diff_text = diff::lines(expected, actual)
|
||||
.into_iter()
|
||||
.map(|diff| match diff {
|
||||
diff::Result::Left(l) => format!("-{}", l),
|
||||
diff::Result::Both(l, _) => format!(" {}", l),
|
||||
diff::Result::Right(r) => format!("+{}", r),
|
||||
diff::Result::Left(l) => format!("-{l}"),
|
||||
diff::Result::Both(l, _) => format!(" {l}"),
|
||||
diff::Result::Right(r) => format!("+{r}"),
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
@@ -290,7 +290,7 @@ impl TestEnv {
|
||||
pub fn assert_failure_with_error(&self, args: &[&str], expected: &str) {
|
||||
let status = self.assert_error_subdirectory(".", args, Some(expected));
|
||||
if status.success() {
|
||||
panic!("error '{}' did not occur.", expected);
|
||||
panic!("error '{expected}' did not occur.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user