Fix ConstParam HasSource impl and implement TryToNav not Nav

This commit is contained in:
Nick Spain 2021-01-02 22:11:25 +11:00
parent 887028fcf5
commit 40cd6cdf67
2 changed files with 8 additions and 8 deletions

View file

@ -142,8 +142,8 @@ impl HasSource for LifetimeParam {
impl HasSource for ConstParam {
type Ast = ast::ConstParam;
fn source(self, db: &dyn HirDatabase) -> InFile<Self::Ast> {
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>> {
let child_source = self.id.parent.child_source(db.upcast());
child_source.map(|it| it[self.id.local_id].clone())
Some(child_source.map(|it| it[self.id.local_id].clone()))
}
}