From ae7e55c1dd801c60092205ec8890179e10a47814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 21 Mar 2021 13:13:34 +0100 Subject: clippy::complexity simplifications related to Iterators --- crates/ide/src/extend_selection.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/extend_selection.rs b/crates/ide/src/extend_selection.rs index e187243cb..5201ce587 100644 --- a/crates/ide/src/extend_selection.rs +++ b/crates/ide/src/extend_selection.rs @@ -263,11 +263,10 @@ fn extend_list_item(node: &SyntaxNode) -> Option { ) -> Option { node.siblings_with_tokens(dir) .skip(1) - .skip_while(|node| match node { - NodeOrToken::Node(_) => false, - NodeOrToken::Token(it) => is_single_line_ws(it), + .find(|node| match node { + NodeOrToken::Node(_) => true, + NodeOrToken::Token(it) => !is_single_line_ws(it), }) - .next() .and_then(|it| it.into_token()) .filter(|node| node.kind() == delimiter_kind) } -- cgit v1.2.3