diff options
Diffstat (limited to 'crates/ra_assists/src/add_explicit_type.rs')
-rw-r--r-- | crates/ra_assists/src/add_explicit_type.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/add_explicit_type.rs b/crates/ra_assists/src/add_explicit_type.rs index cb0ac9885..f3ed74b7f 100644 --- a/crates/ra_assists/src/add_explicit_type.rs +++ b/crates/ra_assists/src/add_explicit_type.rs | |||
@@ -3,7 +3,7 @@ use hir::{ | |||
3 | db::HirDatabase, | 3 | db::HirDatabase, |
4 | }; | 4 | }; |
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
6 | SyntaxKind, | 6 | T, |
7 | ast::{LetStmt, PatKind, NameOwner, AstNode} | 7 | ast::{LetStmt, PatKind, NameOwner, AstNode} |
8 | }; | 8 | }; |
9 | 9 | ||
@@ -24,7 +24,7 @@ pub(crate) fn add_explicit_type(mut ctx: AssistCtx<impl HirDatabase>) -> Option< | |||
24 | let name = pat.name()?; | 24 | let name = pat.name()?; |
25 | let name_range = name.syntax().range(); | 25 | let name_range = name.syntax().range(); |
26 | // Assist not applicable if the type has already been specified | 26 | // Assist not applicable if the type has already been specified |
27 | if stmt.syntax().children_with_tokens().any(|child| child.kind() == SyntaxKind::COLON) { | 27 | if stmt.syntax().children_with_tokens().any(|child| child.kind() == T![:]) { |
28 | return None; | 28 | return None; |
29 | } | 29 | } |
30 | // Infer type | 30 | // Infer type |