From 2695cd92c235e954955a2d7d721d394ea0149ca2 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 17 Aug 2024 08:45:02 +0200 Subject: [PATCH] Simplify .filter().next() into .find() I would have thought clippy already complains about this...? Or does the intermediate .map() confuse it, perhaps? Signed-off-by: Uli Schlachter --- x11rb/src/cursor/find_cursor.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x11rb/src/cursor/find_cursor.rs b/x11rb/src/cursor/find_cursor.rs index e8c6dd78..2b0d4170 100644 --- a/x11rb/src/cursor/find_cursor.rs +++ b/x11rb/src/cursor/find_cursor.rs @@ -96,9 +96,8 @@ static CORE_CURSORS: &[(&str, u16)] = &[ fn cursor_shape_to_id(name: &str) -> Option { CORE_CURSORS .iter() - .filter(|&(name2, _)| name == *name2) + .find(|&(name2, _)| name == *name2) .map(|&(_, id)| id) - .next() } #[cfg(test)]