aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/completions/attribute.rs
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-01-10 15:40:52 +0000
committerLukas Wirth <[email protected]>2021-01-10 16:14:01 +0000
commite618d129030b10ddd55d76c3e451799c7dba3f8d (patch)
tree5c421defb6843fd005ad24488f7d040aa704e6f6 /crates/completion/src/completions/attribute.rs
parente1430d822e20635170c8da92b928d4d89dd1f680 (diff)
Replace SyntaxKind usage with T! macro where applicable
Diffstat (limited to 'crates/completion/src/completions/attribute.rs')
-rw-r--r--crates/completion/src/completions/attribute.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/completion/src/completions/attribute.rs b/crates/completion/src/completions/attribute.rs
index a52ca107e..e5522980d 100644
--- a/crates/completion/src/completions/attribute.rs
+++ b/crates/completion/src/completions/attribute.rs
@@ -5,7 +5,7 @@
5 5
6use itertools::Itertools; 6use itertools::Itertools;
7use rustc_hash::FxHashSet; 7use rustc_hash::FxHashSet;
8use syntax::{ast, AstNode, SyntaxKind}; 8use syntax::{ast, AstNode, T};
9 9
10use crate::{ 10use crate::{
11 context::CompletionContext, 11 context::CompletionContext,
@@ -205,8 +205,7 @@ fn complete_lint(
205fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<String>, ()> { 205fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<String>, ()> {
206 match (derive_input.left_delimiter_token(), derive_input.right_delimiter_token()) { 206 match (derive_input.left_delimiter_token(), derive_input.right_delimiter_token()) {
207 (Some(left_paren), Some(right_paren)) 207 (Some(left_paren), Some(right_paren))
208 if left_paren.kind() == SyntaxKind::L_PAREN 208 if left_paren.kind() == T!['('] && right_paren.kind() == T![')'] =>
209 && right_paren.kind() == SyntaxKind::R_PAREN =>
210 { 209 {
211 let mut input_derives = FxHashSet::default(); 210 let mut input_derives = FxHashSet::default();
212 let mut current_derive = String::new(); 211 let mut current_derive = String::new();
@@ -218,7 +217,7 @@ fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<Strin
218 .skip(1) 217 .skip(1)
219 .take_while(|token| token != &right_paren) 218 .take_while(|token| token != &right_paren)
220 { 219 {
221 if SyntaxKind::COMMA == token.kind() { 220 if T![,] == token.kind() {
222 if !current_derive.is_empty() { 221 if !current_derive.is_empty() {
223 input_derives.insert(current_derive); 222 input_derives.insert(current_derive);
224 current_derive = String::new(); 223 current_derive = String::new();