Remove suspicious unwrap

This commit is contained in:
Lukas Wirth 2023-08-02 12:18:10 +02:00
parent bcff166b3a
commit 6e2c3f610b
7 changed files with 13 additions and 13 deletions

View file

@ -2138,8 +2138,8 @@ impl ExternCrateDecl {
self.id.module(db.upcast()).into()
}
pub fn resolved_crate(self, db: &dyn HirDatabase) -> Crate {
db.extern_crate_decl_data(self.id).crate_id.into()
pub fn resolved_crate(self, db: &dyn HirDatabase) -> Option<Crate> {
db.extern_crate_decl_data(self.id).crate_id.map(Into::into)
}
pub fn name(self, db: &dyn HirDatabase) -> Name {