Skip to content

Commit cbd9f46

Browse files
author
Veetaha
authored
ra_hir_expand: migrate to impl_intern_key!()
1 parent af8097f commit cbd9f46

File tree

1 file changed

+3
-17
lines changed
  • crates/ra_hir_expand/src

1 file changed

+3
-17
lines changed

crates/ra_hir_expand/src/lib.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod eager;
1717
use std::hash::Hash;
1818
use std::sync::Arc;
1919

20-
use ra_db::{salsa, CrateId, FileId};
20+
use ra_db::{salsa, CrateId, FileId, impl_intern_key};
2121
use ra_syntax::{
2222
algo,
2323
ast::{self, AstNode},
@@ -174,25 +174,11 @@ pub enum MacroCallId {
174174

175175
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
176176
pub struct LazyMacroId(salsa::InternId);
177-
impl salsa::InternKey for 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-
}
177+
impl_intern_key!(LazyMacroId);
185178

186179
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
187180
pub struct EagerMacroId(salsa::InternId);
188-
impl salsa::InternKey for 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-
}
181+
impl_intern_key!(EagerMacroId);
196182

197183
impl From<LazyMacroId> for MacroCallId {
198184
fn from(it: LazyMacroId) -> Self {

0 commit comments

Comments
 (0)