From 86f16c3042d9f8ba400512c8f2916c3a40e2d1f8 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 6 Jul 2020 12:42:11 +0800 Subject: =?UTF-8?q?for=20a=20moment=20I=20thought=20'colored'=20could=20be?= =?UTF-8?q?=20used,=20but=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …it's really allocation heavy. Something simpler might be it, what about termcolor? --- src/aggregate.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/aggregate.rs b/src/aggregate.rs index d40a0cf..57103ac 100644 --- a/src/aggregate.rs +++ b/src/aggregate.rs @@ -1,5 +1,6 @@ use crate::{crossdev, InodeFilter, WalkOptions, WalkResult}; use anyhow::Result; +use colored::Colorize; use filesize::PathExt; use std::borrow::Cow; use std::{fmt, io, path::Path}; @@ -129,7 +130,12 @@ fn write_path( writeln!( out, "{byte_color}{:>byte_column_width$}{byte_color_reset} {path_color}{}{path_color_reset}{}", - options.byte_format.display(num_bytes).to_string(), // needed for formatting to work (unless we implement it ourselves) + options + .byte_format + .display(num_bytes) + .to_string() + .as_str() + .green(), // needed for formatting to work (unless we implement it ourselves) path.as_ref().display(), if num_errors == 0 { Cow::Borrowed("") -- cgit v1.2.3