diff --git a/src/uu/dircolors/src/dircolors.rs b/src/uu/dircolors/src/dircolors.rs index 815c3422e42..5454648d796 100644 --- a/src/uu/dircolors/src/dircolors.rs +++ b/src/uu/dircolors/src/dircolors.rs @@ -364,8 +364,7 @@ where let mut state = ParseState::Global; let mut saw_colorterm_match = false; - for (num, line) in user_input.into_iter().enumerate() { - let num = num + 1; + for (num, line) in (1..).zip(user_input.into_iter()) { let line = line.borrow().purify(); if line.is_empty() { continue; diff --git a/src/uu/sort/src/sort.rs b/src/uu/sort/src/sort.rs index ba5d34a5660..05233a01d50 100644 --- a/src/uu/sort/src/sort.rs +++ b/src/uu/sort/src/sort.rs @@ -1799,8 +1799,7 @@ fn emit_debug_warnings( show_error!("{}", translate!("sort-warning-simple-byte-comparison")); - for (idx, selector) in settings.selectors.iter().enumerate() { - let key_index = idx + 1; + for (key_index, selector) in (1..).zip(settings.selectors.iter()) { if let Some(legacy) = legacy_warnings .iter() .find(|warning| warning.key_index == Some(key_index))