Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 85d2d84

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

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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
) -> impl Iterator<Item = &ty::AssocItem> {
62-
let iter: Box<dyn Iterator<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)