Fix macro reexports duplicates in the sidebar
This commit is contained in:
parent
52dd59ed21
commit
bc4b0a774c
1 changed files with 11 additions and 6 deletions
|
@ -250,6 +250,8 @@ impl<'tcx> Context<'tcx> {
|
||||||
fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc>> {
|
fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc>> {
|
||||||
// BTreeMap instead of HashMap to get a sorted output
|
// BTreeMap instead of HashMap to get a sorted output
|
||||||
let mut map: BTreeMap<_, Vec<_>> = BTreeMap::new();
|
let mut map: BTreeMap<_, Vec<_>> = BTreeMap::new();
|
||||||
|
let mut inserted: FxHashMap<ItemType, FxHashSet<Symbol>> = FxHashMap::default();
|
||||||
|
|
||||||
for item in &m.items {
|
for item in &m.items {
|
||||||
if item.is_stripped() {
|
if item.is_stripped() {
|
||||||
continue;
|
continue;
|
||||||
|
@ -258,14 +260,17 @@ impl<'tcx> Context<'tcx> {
|
||||||
let short = item.type_();
|
let short = item.type_();
|
||||||
let myname = match item.name {
|
let myname = match item.name {
|
||||||
None => continue,
|
None => continue,
|
||||||
Some(ref s) => s.to_string(),
|
Some(s) => s,
|
||||||
};
|
};
|
||||||
|
if inserted.entry(short).or_default().insert(myname) {
|
||||||
let short = short.to_string();
|
let short = short.to_string();
|
||||||
|
let myname = myname.to_string();
|
||||||
map.entry(short).or_default().push((
|
map.entry(short).or_default().push((
|
||||||
myname,
|
myname,
|
||||||
Some(item.doc_value().map_or_else(String::new, |s| plain_text_summary(&s))),
|
Some(item.doc_value().map_or_else(String::new, |s| plain_text_summary(&s))),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if self.shared.sort_modules_alphabetically {
|
if self.shared.sort_modules_alphabetically {
|
||||||
for items in map.values_mut() {
|
for items in map.values_mut() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue