diff --git a/common/src/region.rs b/common/src/region.rs index 3db7fdaf54..6949f63a7d 100644 --- a/common/src/region.rs +++ b/common/src/region.rs @@ -301,7 +301,6 @@ impl RegionMap { } /// Add a region using its key - #[allow(clippy::needless_range_loop)] // TODO: Pending review in #587 fn remove_index(&mut self, index: usize) { // Remap neighbor indices for neighbors of the region that will be moved from // the end of the index map @@ -312,10 +311,10 @@ impl RegionMap { .map(|(_, v)| v) .unwrap() .neighbors; - for i in 0..8 { - if let Some(idx) = moved_neighbors[i] { + for (i, possible_idx) in moved_neighbors.iter().enumerate() { + if let Some(idx) = possible_idx { self.regions - .get_index_mut(idx) + .get_index_mut(*idx) .map(|(_, v)| v) .unwrap() .neighbors[(i + 4) % 8] = Some(index); diff --git a/voxygen/src/ui/widgets/radio_list.rs b/voxygen/src/ui/widgets/radio_list.rs index 08cf5aa331..f9e476a014 100644 --- a/voxygen/src/ui/widgets/radio_list.rs +++ b/voxygen/src/ui/widgets/radio_list.rs @@ -115,7 +115,6 @@ impl<'a, T> Widget for RadioList<'a, T> { fn style(&self) -> Self::Style {} - #[allow(clippy::needless_range_loop)] // TODO: Pending review in #587 fn update(self, args: widget::UpdateArgs) -> Self::Event { let widget::UpdateArgs { id, @@ -165,7 +164,7 @@ impl<'a, T> Widget for RadioList<'a, T> { .unwrap_or(selected); let (x, y, w, h) = rect.x_y_w_h(); - for i in 0..num_items { + for (i, _j) in options_labels.iter().enumerate().take(num_items) { let image = if i == current_selection { t_image } else {