Make MacroDefId's AstId mandatory when possible

This commit is contained in:
Jonas Schievink 2021-03-18 15:37:14 +01:00
parent 816bc73895
commit b84efbaacf
13 changed files with 58 additions and 55 deletions

View file

@ -113,7 +113,7 @@ impl HasSource for TypeAlias {
impl HasSource for MacroDef {
type Ast = ast::Macro;
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>> {
let ast_id = self.id.ast_id?;
let ast_id = self.id.ast_id()?;
Some(InFile { file_id: ast_id.file_id, value: ast_id.to_node(db.upcast()) })
}
}