From dd720344ce8f78946b84fb9dc55874309658d79f Mon Sep 17 00:00:00 2001 From: mattsu Date: Thu, 22 Jan 2026 08:44:50 +0900 Subject: [PATCH] refactor(sort): simplify detect_numeric_locale with struct literal Use struct literal initialization instead of creating a mutable default and assigning fields, improving code conciseness and readability without changing functionality. --- src/uu/sort/src/sort.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index 51cdb862b..b3061f9b2 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -1322,13 +1322,13 @@ impl FieldSelector { } fn detect_numeric_locale() -> NumericLocaleSettings { - let mut settings = NumericLocaleSettings::default(); - settings.decimal_pt = Some(locale_decimal_pt()); - settings.thousands_sep = match i18n::decimal::locale_grouping_separator().as_bytes() { - [b] => Some(*b), - _ => None, - }; - settings + NumericLocaleSettings { + decimal_pt: Some(locale_decimal_pt()), + thousands_sep: match i18n::decimal::locale_grouping_separator().as_bytes() { + [b] => Some(*b), + _ => None, + }, + } } /// Creates an `Arg` for a sort mode flag. fn make_sort_mode_arg(mode: &'static str, short: char, help: String) -> Arg {