Remove duplication in fold_item

This commit is contained in:
Joshua Nelson 2020-08-20 11:19:11 -04:00
parent 9900178cba
commit d468a81a8a

View file

@ -636,7 +636,7 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
}
match disambiguator.map(Disambiguator::ns) {
Some(ns @ ValueNS) => {
Some(ns @ ValueNS | ns @ TypeNS) => {
match self.resolve(
path_str,
disambiguator,
@ -660,28 +660,6 @@ impl<'a, 'tcx> DocFolder for LinkCollector<'a, 'tcx> {
}
}
}
Some(ns @ TypeNS) => {
match self.resolve(
path_str,
disambiguator,
ns,
&current_item,
base_node,
&extra_fragment,
Some(&item),
) {
Ok(res) => res,
Err(ErrorKind::ResolutionFailure) => {
resolution_failure(cx, &item, path_str, &dox, link_range);
// This could just be a normal link.
continue;
}
Err(ErrorKind::AnchorFailure(msg)) => {
anchor_failure(cx, &item, &ori_link, &dox, link_range, msg);
continue;
}
}
}
None => {
// Try everything!
let mut candidates = PerNS {