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.
This commit is contained in:
mattsu
2026-01-22 08:44:50 +09:00
committed by Sylvestre Ledru
parent 39ed771fd1
commit dd720344ce
+7 -7
View File
@@ -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 {