Change to use Expansion::file_id and reordering

This commit is contained in:
Edwin Cheng 2019-11-19 22:56:28 +08:00
parent 8010b42b21
commit 94c63d2802
2 changed files with 40 additions and 46 deletions

View file

@ -140,12 +140,7 @@ impl Expansion {
exp_info.map_token_down(token)
}
pub fn source(&self, db: &impl HirDatabase) -> Source<AstId<ast::MacroCall>> {
let loc = db.lookup_intern_macro(self.macro_call_id);
Source::new(self.file_id(), loc.ast_id)
}
fn file_id(&self) -> HirFileId {
pub fn file_id(&self) -> HirFileId {
self.macro_call_id.as_file(MacroFileKind::Items)
}
}