mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Resolve all '#[allow(clippy::needless_range_loop)]' error supressions
This commit is contained in:
parent
dde1bacad7
commit
f4c5abf36b
@ -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);
|
||||
|
@ -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>) -> 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 {
|
||||
|
Loading…
Reference in New Issue
Block a user