diff options
author | Aleksey Kladov <[email protected]> | 2019-10-29 13:12:54 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-29 13:12:54 +0000 |
commit | 99b6ecfab061396613c5f459fae43ea17b5675b8 (patch) | |
tree | e77386081251b4150049810ad5e6f2a3b538afb9 /crates/ra_hir_expand/src/lib.rs | |
parent | 3260639608112738089d134c47c1d575515c9cb7 (diff) |
switch expand to dyn Trait
Diffstat (limited to 'crates/ra_hir_expand/src/lib.rs')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 9100bd15c..749227465 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -63,7 +63,7 @@ impl From<MacroFile> for HirFileId { | |||
63 | impl HirFileId { | 63 | impl HirFileId { |
64 | /// For macro-expansion files, returns the file original source file the | 64 | /// For macro-expansion files, returns the file original source file the |
65 | /// expansion originated from. | 65 | /// expansion originated from. |
66 | pub fn original_file(self, db: &impl AstDatabase) -> FileId { | 66 | pub fn original_file(self, db: &dyn AstDatabase) -> FileId { |
67 | match self.0 { | 67 | match self.0 { |
68 | HirFileIdRepr::FileId(file_id) => file_id, | 68 | HirFileIdRepr::FileId(file_id) => file_id, |
69 | HirFileIdRepr::MacroFile(macro_file) => { | 69 | HirFileIdRepr::MacroFile(macro_file) => { |
@@ -74,7 +74,7 @@ impl HirFileId { | |||
74 | } | 74 | } |
75 | 75 | ||
76 | /// Get the crate which the macro lives in, if it is a macro file. | 76 | /// Get the crate which the macro lives in, if it is a macro file. |
77 | pub fn macro_crate(self, db: &impl AstDatabase) -> Option<CrateId> { | 77 | pub fn macro_crate(self, db: &dyn AstDatabase) -> Option<CrateId> { |
78 | match self.0 { | 78 | match self.0 { |
79 | HirFileIdRepr::FileId(_) => None, | 79 | HirFileIdRepr::FileId(_) => None, |
80 | HirFileIdRepr::MacroFile(macro_file) => { | 80 | HirFileIdRepr::MacroFile(macro_file) => { |
@@ -160,7 +160,7 @@ impl<N: AstNode> AstId<N> { | |||
160 | self.file_id | 160 | self.file_id |
161 | } | 161 | } |
162 | 162 | ||
163 | pub fn to_node(&self, db: &impl AstDatabase) -> N { | 163 | pub fn to_node(&self, db: &dyn AstDatabase) -> N { |
164 | let root = db.parse_or_expand(self.file_id).unwrap(); | 164 | let root = db.parse_or_expand(self.file_id).unwrap(); |
165 | db.ast_id_map(self.file_id).get(self.file_ast_id).to_node(&root) | 165 | db.ast_id_map(self.file_id).get(self.file_ast_id).to_node(&root) |
166 | } | 166 | } |