From 1d674c714a03566cd73e755f8e47e67789553e21 Mon Sep 17 00:00:00 2001 From: Maccesch Date: Thu, 10 Aug 2023 21:38:32 +0100 Subject: [PATCH] chore: clippy --- src/use_element_visibility.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/use_element_visibility.rs b/src/use_element_visibility.rs index 26202cb..6be8b51 100644 --- a/src/use_element_visibility.rs +++ b/src/use_element_visibility.rs @@ -66,14 +66,10 @@ where move |entries, _| { // In some circumstances Chrome passes a first (or only) entry which has a zero bounding client rect // and returns `is_intersecting` erroneously as `false`. - if let Some(entry) = entries - .into_iter() - .filter(|entry| { - let rect = entry.bounding_client_rect(); - rect.width() > 0.0 || rect.height() > 0.0 - }) - .next() - { + if let Some(entry) = entries.into_iter().find(|entry| { + let rect = entry.bounding_client_rect(); + rect.width() > 0.0 || rect.height() > 0.0 + }) { set_visible.set(entry.is_intersecting()); } },