diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index 10bd76718..89d4520d3 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -2046,25 +2046,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { .unwrap_or_default() }; - let mut mode_flags = ModeFlags::default(); - if matches.get_flag(options::modes::HUMAN_NUMERIC) { - mode_flags.human_numeric = true; - } - if matches.get_flag(options::modes::MONTH) { - mode_flags.month = true; - } - if matches.get_flag(options::modes::GENERAL_NUMERIC) { - mode_flags.general_numeric = true; - } - if matches.get_flag(options::modes::NUMERIC) { - mode_flags.numeric = true; - } - if matches.get_flag(options::modes::VERSION) { - mode_flags.version = true; - } - if matches.get_flag(options::modes::RANDOM) { - mode_flags.random = true; - } + let mut mode_flags = ModeFlags { + human_numeric: matches.get_flag(options::modes::HUMAN_NUMERIC), + month: matches.get_flag(options::modes::MONTH), + general_numeric: matches.get_flag(options::modes::GENERAL_NUMERIC), + numeric: matches.get_flag(options::modes::NUMERIC), + version: matches.get_flag(options::modes::VERSION), + random: matches.get_flag(options::modes::RANDOM), + }; if let Some(sort_arg) = matches.get_one::(options::modes::SORT) { match sort_arg.as_str() { "human-numeric" => mode_flags.human_numeric = true,