From e618d129030b10ddd55d76c3e451799c7dba3f8d Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 10 Jan 2021 16:40:52 +0100 Subject: Replace SyntaxKind usage with T! macro where applicable --- crates/completion/src/patterns.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/completion/src/patterns.rs') diff --git a/crates/completion/src/patterns.rs b/crates/completion/src/patterns.rs index f148b9402..f3ce91dd1 100644 --- a/crates/completion/src/patterns.rs +++ b/crates/completion/src/patterns.rs @@ -5,7 +5,7 @@ use syntax::{ ast::{self, LoopBodyOwner}, match_ast, AstNode, Direction, NodeOrToken, SyntaxElement, SyntaxKind::*, - SyntaxNode, SyntaxToken, + SyntaxNode, SyntaxToken, T, }; #[cfg(test)] @@ -119,7 +119,7 @@ pub(crate) fn unsafe_is_prev(element: SyntaxElement) -> bool { element .into_token() .and_then(|it| previous_non_trivia_token(it)) - .filter(|it| it.kind() == UNSAFE_KW) + .filter(|it| it.kind() == T![unsafe]) .is_some() } #[test] @@ -131,7 +131,7 @@ pub(crate) fn if_is_prev(element: SyntaxElement) -> bool { element .into_token() .and_then(|it| previous_non_trivia_token(it)) - .filter(|it| it.kind() == IF_KW) + .filter(|it| it.kind() == T![if]) .is_some() } @@ -139,7 +139,7 @@ pub(crate) fn fn_is_prev(element: SyntaxElement) -> bool { element .into_token() .and_then(|it| previous_non_trivia_token(it)) - .filter(|it| it.kind() == FN_KW) + .filter(|it| it.kind() == T![fn]) .is_some() } #[test] @@ -154,7 +154,7 @@ pub(crate) fn for_is_prev2(element: SyntaxElement) -> bool { .into_token() .and_then(|it| previous_non_trivia_token(it)) .and_then(|it| previous_non_trivia_token(it)) - .filter(|it| it.kind() == FOR_KW) + .filter(|it| it.kind() == T![for]) .is_some() } #[test] -- cgit v1.2.3