1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

sort: replace redundant closure with function itself

This commit is contained in:
Jeffrey Finkelstein 2021-10-01 23:02:17 -04:00
parent 06ae968ecf
commit de158c0122

View file

@ -825,7 +825,7 @@ impl FieldSelector {
fn parse(key: &str, global_settings: &GlobalSettings) -> UResult<Self> { fn parse(key: &str, global_settings: &GlobalSettings) -> UResult<Self> {
let mut from_to = key.split(','); let mut from_to = key.split(',');
let (from, from_options) = Self::split_key_options(from_to.next().unwrap()); let (from, from_options) = Self::split_key_options(from_to.next().unwrap());
let to = from_to.next().map(|to| Self::split_key_options(to)); let to = from_to.next().map(Self::split_key_options);
let options_are_empty = from_options.is_empty() && matches!(to, None | Some((_, ""))); let options_are_empty = from_options.is_empty() && matches!(to, None | Some((_, "")));
if options_are_empty { if options_are_empty {