mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
sort: remove redundant if (#10716)
This commit is contained in:
+8
-19
@@ -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::<String>(options::modes::SORT) {
|
||||
match sort_arg.as_str() {
|
||||
"human-numeric" => mode_flags.human_numeric = true,
|
||||
|
||||
Reference in New Issue
Block a user