diff options
author | Veetaha <[email protected]> | 2020-03-15 16:25:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-15 16:25:55 +0000 |
commit | cbd9f46bc776cc6e7a0383af5e0053542400af55 (patch) | |
tree | 95c96547340669d8f33959a7f71ccf9dc8897532 /crates | |
parent | af8097f7775e59fd2d61298b6d682788e870c2f9 (diff) |
ra_hir_expand: migrate to impl_intern_key!()
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 3fce73e8a..b3f2b09a6 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs | |||
@@ -17,7 +17,7 @@ pub mod eager; | |||
17 | use std::hash::Hash; | 17 | use std::hash::Hash; |
18 | use std::sync::Arc; | 18 | use std::sync::Arc; |
19 | 19 | ||
20 | use ra_db::{salsa, CrateId, FileId}; | 20 | use ra_db::{salsa, CrateId, FileId, impl_intern_key}; |
21 | use ra_syntax::{ | 21 | use ra_syntax::{ |
22 | algo, | 22 | algo, |
23 | ast::{self, AstNode}, | 23 | ast::{self, AstNode}, |
@@ -174,25 +174,11 @@ pub enum MacroCallId { | |||
174 | 174 | ||
175 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 175 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
176 | pub struct LazyMacroId(salsa::InternId); | 176 | pub struct LazyMacroId(salsa::InternId); |
177 | impl salsa::InternKey for LazyMacroId { | 177 | impl_intern_key!(LazyMacroId); |
178 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
179 | LazyMacroId(v) | ||
180 | } | ||
181 | fn as_intern_id(&self) -> salsa::InternId { | ||
182 | self.0 | ||
183 | } | ||
184 | } | ||
185 | 178 | ||
186 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 179 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
187 | pub struct EagerMacroId(salsa::InternId); | 180 | pub struct EagerMacroId(salsa::InternId); |
188 | impl salsa::InternKey for EagerMacroId { | 181 | impl_intern_key!(EagerMacroId); |
189 | fn from_intern_id(v: salsa::InternId) -> Self { | ||
190 | EagerMacroId(v) | ||
191 | } | ||
192 | fn as_intern_id(&self) -> salsa::InternId { | ||
193 | self.0 | ||
194 | } | ||
195 | } | ||
196 | 182 | ||
197 | impl From<LazyMacroId> for MacroCallId { | 183 | impl From<LazyMacroId> for MacroCallId { |
198 | fn from(it: LazyMacroId) -> Self { | 184 | fn from(it: LazyMacroId) -> Self { |