diff --git a/src/uu/ls/src/config.rs b/src/uu/ls/src/config.rs index 2cc87c788..383d36451 100644 --- a/src/uu/ls/src/config.rs +++ b/src/uu/ls/src/config.rs @@ -311,9 +311,9 @@ fn extract_sort(options: &clap::ArgMatches) -> Sort { }; let sort_index = options - .get_one::(options::SORT) - .and_then(|_| options.indices_of(options::SORT)) - .map_or(0, |mut indices| indices.next_back().unwrap_or(0)); + .indices_of(options::SORT) + .and_then(|mut it| it.next_back()) + .unwrap_or(0); let time_index = get_last_index(options::sort::TIME); let size_index = get_last_index(options::sort::SIZE); let none_index = get_last_index(options::sort::NONE); @@ -427,9 +427,9 @@ fn extract_color(options: &clap::ArgMatches) -> bool { }; let color_index = options - .get_one::(options::COLOR) - .and_then(|_| options.indices_of(options::COLOR)) - .map_or(0, |mut indices| indices.next_back().unwrap_or(0)); + .indices_of(options::COLOR) + .and_then(|mut it| it.next_back()) + .unwrap_or(0); let unsorted_all_index = get_last_index(options::files::UNSORTED_ALL); let color_enabled = match options.get_one::(options::COLOR) {