Skip to content

Commit ac1ba37

Browse files
committed
numfmt: use consistent debug warning format
Use the existing print_warning helper for the grouping-no-effect message instead of a one-off writeln with util_name(). Use hardcoded "numfmt:" prefix for the failed-to-convert message to match the other debug warnings. Remove now-unused util_name import.
1 parent e1166da commit ac1ba37

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

src/uu/numfmt/src/numfmt.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ use std::str::FromStr;
2020
use units::{IEC_BASES, SI_BASES};
2121
use uucore::display::Quotable;
2222
use uucore::error::UResult;
23-
use uucore::util_name;
24-
2523
use uucore::i18n::decimal::locale_grouping_separator;
2624
use uucore::parser::shortcut_value_parser::ShortcutValueParser;
2725
use uucore::ranges::Range;
@@ -349,12 +347,7 @@ fn print_debug_warnings(options: &NumfmtOptions, matches: &ArgMatches) {
349347
}
350348

351349
if options.grouping && locale_grouping_separator().is_empty() {
352-
let _ = writeln!(
353-
stderr(),
354-
"{}: {}",
355-
util_name(),
356-
translate!("numfmt-debug-grouping-no-effect")
357-
);
350+
print_warning("numfmt-debug-grouping-no-effect");
358351
}
359352

360353
// Warn if --header is used with command-line input
@@ -404,8 +397,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
404397
if options.debug && saw_invalid {
405398
let _ = writeln!(
406399
stderr(),
407-
"{}: {}",
408-
util_name(),
400+
"numfmt: {}",
409401
translate!("numfmt-debug-failed-to-convert")
410402
);
411403
}

0 commit comments

Comments
 (0)