From 6eddc6e3fcb6bbd8003c6bd65fb9ff78cb2a8909 Mon Sep 17 00:00:00 2001 From: white-axe Date: Sun, 17 Sep 2023 17:40:59 +0000 Subject: [PATCH] Apply another clippy recommendation --- src/tabs/map.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/tabs/map.rs b/src/tabs/map.rs index 845c6e22..9354a3eb 100644 --- a/src/tabs/map.rs +++ b/src/tabs/map.rs @@ -453,16 +453,10 @@ impl tab::Tab for Tab { // If dragging an event and the cursor is not hovering over the tile of // a different event, move the dragged event's tile to the cursor let adjusted_hover_tile = hover_tile + offset; - if map - .events - .iter() - .filter(|(_, e)| { - adjusted_hover_tile.x == e.x as f32 - && adjusted_hover_tile.y == e.y as f32 - }) - .next() - .is_none() - { + if !map.events.iter().any(|(_, e)| { + adjusted_hover_tile.x == e.x as f32 + && adjusted_hover_tile.y == e.y as f32 + }) { if let Some(selected_event) = map.events.get_mut(selected_event_id) {