From 60dda08266895f72d609b78f8824724c61e5e45e Mon Sep 17 00:00:00 2001 From: Johann Hemmann Date: Fri, 19 Jan 2024 14:01:37 +0100 Subject: [PATCH] manual_find --- Cargo.toml | 1 - crates/ide-ssr/src/matching.rs | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4128e7789..847ad08131 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -182,7 +182,6 @@ get_first = "allow" if_same_then_else = "allow" large_enum_variant = "allow" let_and_return = "allow" -manual_find = "allow" manual_map = "allow" map_clone = "allow" match_like_matches_macro = "allow" diff --git a/crates/ide-ssr/src/matching.rs b/crates/ide-ssr/src/matching.rs index 66cb14451f..3e6b2d4dd9 100644 --- a/crates/ide-ssr/src/matching.rs +++ b/crates/ide-ssr/src/matching.rs @@ -764,12 +764,7 @@ impl Iterator for PatternIterator { type Item = SyntaxElement; fn next(&mut self) -> Option { - for element in &mut self.iter { - if !element.kind().is_trivia() { - return Some(element); - } - } - None + (&mut self.iter).find(|element| !element.kind().is_trivia()) } }