Remove unwrap in doc path resolution

This commit is contained in:
John-John Tedro 2021-11-18 05:19:58 +01:00
parent fdd49b9713
commit 76e3feeeb5

View file

@ -147,7 +147,7 @@ fn resolve_doc_path(
AttrDefId::MacroDefId(_) => return None,
};
let path = ast::Path::parse(link).ok()?;
let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic()).unwrap();
let modpath = ModPath::from_src(db.upcast(), path, &Hygiene::new_unhygienic())?;
let resolved = resolver.resolve_module_path_in_items(db.upcast(), &modpath);
let resolved = if resolved == PerNs::none() {
resolver.resolve_module_path_in_trait_assoc_items(db.upcast(), &modpath)?