Skip to content

Commit b865db0

Browse files
Sort "implementations on foreign types" section in the sidebar
1 parent 97f3eee commit b865db0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/librustdoc/html/render.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -4344,20 +4344,19 @@ fn sidebar_trait(buf: &mut Buffer, it: &clean::Item, t: &clean::Trait) {
43444344
let mut res = implementors
43454345
.iter()
43464346
.filter(|i| i.inner_impl().for_.def_id().map_or(false, |d| !c.paths.contains_key(&d)))
4347-
.filter_map(|i| match extract_for_impl_name(&i.impl_item) {
4348-
Some((ref name, ref id)) => {
4349-
Some(format!("<a href=\"#{}\">{}</a>", id, Escape(name)))
4350-
}
4351-
_ => None,
4352-
})
4353-
.collect::<Vec<String>>();
4347+
.filter_map(|i| extract_for_impl_name(&i.impl_item))
4348+
.collect::<Vec<_>>();
4349+
43544350
if !res.is_empty() {
43554351
res.sort();
43564352
sidebar.push_str(&format!(
43574353
"<a class=\"sidebar-title\" href=\"#foreign-impls\">\
43584354
Implementations on Foreign Types</a><div \
43594355
class=\"sidebar-links\">{}</div>",
4360-
res.join("")
4356+
res.into_iter()
4357+
.map(|(name, id)| format!("<a href=\"#{}\">{}</a>", id, Escape(&name)))
4358+
.collect::<Vec<_>>()
4359+
.join("")
43614360
));
43624361
}
43634362
}

0 commit comments

Comments
 (0)