diff options
author | Aleksey Kladov <[email protected]> | 2020-04-09 22:35:05 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-09 22:42:01 +0100 |
commit | 30084a56a5731343bd4cec727646a6c55900234f (patch) | |
tree | cca4821454502279317323fbc63dccdb9c68c5b9 /crates/ra_hir_ty/src | |
parent | 00ec0c10669307bc752812f535f96e121338d688 (diff) |
Simpler acessors for keywords
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/tests.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs index 3b078b8c7..002cffba6 100644 --- a/crates/ra_hir_ty/src/tests.rs +++ b/crates/ra_hir_ty/src/tests.rs | |||
@@ -23,7 +23,7 @@ use insta::assert_snapshot; | |||
23 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; | 23 | use ra_db::{fixture::WithFixture, salsa::Database, FilePosition, SourceDatabase}; |
24 | use ra_syntax::{ | 24 | use ra_syntax::{ |
25 | algo, | 25 | algo, |
26 | ast::{self, AstNode, AstToken}, | 26 | ast::{self, AstNode}, |
27 | }; | 27 | }; |
28 | use stdx::format_to; | 28 | use stdx::format_to; |
29 | 29 | ||
@@ -101,7 +101,7 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { | |||
101 | let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db)); | 101 | let node = src_ptr.value.to_node(&src_ptr.file_syntax(&db)); |
102 | 102 | ||
103 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { | 103 | let (range, text) = if let Some(self_param) = ast::SelfParam::cast(node.clone()) { |
104 | (self_param.self_kw_token().unwrap().syntax().text_range(), "self".to_string()) | 104 | (self_param.self_token().unwrap().text_range(), "self".to_string()) |
105 | } else { | 105 | } else { |
106 | (src_ptr.value.range(), node.text().to_string().replace("\n", " ")) | 106 | (src_ptr.value.range(), node.text().to_string().replace("\n", " ")) |
107 | }; | 107 | }; |