Skip to content

Commit 85d2d84

Browse files
committed
Remove is_empty check in filter_assoc_items_by_name_and_namespace.
It was added in #140052, but the subsequent changes in #140252 means it is no longer necessary. (Indeed, `Ident`s cannot be empty any more.)
1 parent bf64d66 commit 85d2d84

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

‎src/librustdoc/passes/collect_intra_doc_links.rs‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,7 @@ fn filter_assoc_items_by_name_and_namespace(
5959
ident:Ident,
6060
ns:Namespace,
6161
) -> implIterator<Item = &ty::AssocItem>{
62-
let iter:Box<dynIterator<Item = &ty::AssocItem>> = if !ident.name.is_empty(){
63-
Box::new(tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name))
64-
}else{
65-
Box::new([].iter())
66-
};
67-
iter.filter(move |item| {
62+
tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name).filter(move |item| {
6863
item.namespace() == ns && tcx.hygienic_eq(ident, item.ident(tcx), assoc_items_of)
6964
})
7065
}

0 commit comments

Comments
 (0)