summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack O'Connor <oconnor663@gmail.com>2019-06-15 10:20:19 -0400
committerSebastian Thiel <sthiel@thoughtworks.com>2019-06-16 10:46:57 +0800
commitfba47e68757341b76b168ebf4d8b631a826712fc (patch)
treedc1558d2a1e4985bc5d6d60aaad256b859a661e1
parent49bc227d9b5adfcf27c78eca763a28ce51f26211 (diff)
error formatting suggestions
We can avoid the `(s)` by inspecting the number. And using spaces instead of tabs makes the output more consistent in a terminal, no longer depending on the length of the preceding filename.
-rw-r--r--src/aggregate.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/aggregate.rs b/src/aggregate.rs
index 7e09d17..ff0e73b 100644
--- a/src/aggregate.rs
+++ b/src/aggregate.rs
@@ -118,7 +118,11 @@ fn write_path<C: fmt::Display>(
if num_errors == 0 {
Cow::Borrowed("")
} else {
- Cow::Owned(format!("\t<{} IO Error(s)>", num_errors))
+ Cow::Owned(format!(
+ " <{} IO Error{}>",
+ num_errors,
+ if num_errors > 1 { "s" } else { "" }
+ ))
},
byte_color = options.color.display(color::Fg(color::Green)),
byte_color_reset = options.color.display(color::Fg(color::Reset)),