aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src
diff options
context:
space:
mode:
authorMaan2003 <[email protected]>2021-06-13 04:59:36 +0100
committerMaan2003 <[email protected]>2021-06-13 04:59:36 +0100
commit75370312fbfe072947ffdc568eebc9cb4c6108e4 (patch)
treecb435a1c147db6891c7f6cf625efd8876f427788 /crates/ide_completion/src
parent705f7e6e2644bf5de4255bc05ea8d9d5027c29b0 (diff)
clippy::redundant_closure
Diffstat (limited to 'crates/ide_completion/src')
-rw-r--r--crates/ide_completion/src/context.rs2
-rw-r--r--crates/ide_completion/src/patterns.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs
index e4abe2742..4c3929a26 100644
--- a/crates/ide_completion/src/context.rs
+++ b/crates/ide_completion/src/context.rs
@@ -380,7 +380,7 @@ impl<'a> CompletionContext<'a> {
380 (|| { 380 (|| {
381 let expr_field = self.token.prev_sibling_or_token()? 381 let expr_field = self.token.prev_sibling_or_token()?
382 .into_node() 382 .into_node()
383 .and_then(|node| ast::RecordExprField::cast(node))?; 383 .and_then(ast::RecordExprField::cast)?;
384 let (_, _, ty) = self.sema.resolve_record_field(&expr_field)?; 384 let (_, _, ty) = self.sema.resolve_record_field(&expr_field)?;
385 Some(( 385 Some((
386 Some(ty), 386 Some(ty),
diff --git a/crates/ide_completion/src/patterns.rs b/crates/ide_completion/src/patterns.rs
index c567ac63d..72e67e3c4 100644
--- a/crates/ide_completion/src/patterns.rs
+++ b/crates/ide_completion/src/patterns.rs
@@ -259,7 +259,7 @@ fn test_inside_impl_trait_block() {
259} 259}
260 260
261pub(crate) fn previous_token(element: SyntaxElement) -> Option<SyntaxToken> { 261pub(crate) fn previous_token(element: SyntaxElement) -> Option<SyntaxToken> {
262 element.into_token().and_then(|it| previous_non_trivia_token(it)) 262 element.into_token().and_then(previous_non_trivia_token)
263} 263}
264 264
265/// Check if the token previous to the previous one is `for`. 265/// Check if the token previous to the previous one is `for`.
@@ -267,8 +267,8 @@ pub(crate) fn previous_token(element: SyntaxElement) -> Option<SyntaxToken> {
267pub(crate) fn for_is_prev2(element: SyntaxElement) -> bool { 267pub(crate) fn for_is_prev2(element: SyntaxElement) -> bool {
268 element 268 element
269 .into_token() 269 .into_token()
270 .and_then(|it| previous_non_trivia_token(it)) 270 .and_then(previous_non_trivia_token)
271 .and_then(|it| previous_non_trivia_token(it)) 271 .and_then(previous_non_trivia_token)
272 .filter(|it| it.kind() == T![for]) 272 .filter(|it| it.kind() == T![for])
273 .is_some() 273 .is_some()
274} 274}