Sort "implementations on foreign types" section in the sidebar
This commit is contained in:
parent
97f3eeec82
commit
b865db0462
1 changed files with 7 additions and 8 deletions
|
@ -4344,20 +4344,19 @@ fn sidebar_trait(buf: &mut Buffer, it: &clean::Item, t: &clean::Trait) {
|
||||||
let mut res = implementors
|
let mut res = implementors
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|i| i.inner_impl().for_.def_id().map_or(false, |d| !c.paths.contains_key(&d)))
|
.filter(|i| i.inner_impl().for_.def_id().map_or(false, |d| !c.paths.contains_key(&d)))
|
||||||
.filter_map(|i| match extract_for_impl_name(&i.impl_item) {
|
.filter_map(|i| extract_for_impl_name(&i.impl_item))
|
||||||
Some((ref name, ref id)) => {
|
.collect::<Vec<_>>();
|
||||||
Some(format!("<a href=\"#{}\">{}</a>", id, Escape(name)))
|
|
||||||
}
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
.collect::<Vec<String>>();
|
|
||||||
if !res.is_empty() {
|
if !res.is_empty() {
|
||||||
res.sort();
|
res.sort();
|
||||||
sidebar.push_str(&format!(
|
sidebar.push_str(&format!(
|
||||||
"<a class=\"sidebar-title\" href=\"#foreign-impls\">\
|
"<a class=\"sidebar-title\" href=\"#foreign-impls\">\
|
||||||
Implementations on Foreign Types</a><div \
|
Implementations on Foreign Types</a><div \
|
||||||
class=\"sidebar-links\">{}</div>",
|
class=\"sidebar-links\">{}</div>",
|
||||||
res.join("")
|
res.into_iter()
|
||||||
|
.map(|(name, id)| format!("<a href=\"#{}\">{}</a>", id, Escape(&name)))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join("")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue