Get rid of unneeded aliases
field
This commit is contained in:
parent
5f92951d4f
commit
2370e3b439
2 changed files with 6 additions and 6 deletions
|
@ -120,10 +120,6 @@ crate struct Cache {
|
|||
// when gathering trait documentation on a type, hold impls here while
|
||||
// folding and add them to the cache later on if we find the trait.
|
||||
orphan_trait_impls: Vec<(DefId, FxHashSet<DefId>, Impl)>,
|
||||
|
||||
/// Aliases added through `#[doc(alias = "...")]`. Since a few items can have the same alias,
|
||||
/// we need the alias element to have an array of items.
|
||||
crate aliases: BTreeMap<String, Vec<usize>>,
|
||||
}
|
||||
|
||||
/// This struct is used to wrap the `cache` and `tcx` in order to run `DocFolder`.
|
||||
|
|
|
@ -87,7 +87,11 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
|
|||
}
|
||||
}
|
||||
|
||||
let Cache { ref mut search_index, ref paths, ref mut aliases, .. } = *cache;
|
||||
let Cache { ref mut search_index, ref paths, .. } = *cache;
|
||||
|
||||
// Aliases added through `#[doc(alias = "...")]`. Since a few items can have the same alias,
|
||||
// we need the alias element to have an array of items.
|
||||
let mut aliases: BTreeMap<String, Vec<usize>> = BTreeMap::new();
|
||||
|
||||
// Sort search index items. This improves the compressibility of the search index.
|
||||
search_index.sort_unstable_by(|k1, k2| {
|
||||
|
@ -210,7 +214,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<
|
|||
doc: crate_doc,
|
||||
items: crate_items,
|
||||
paths: crate_paths,
|
||||
aliases,
|
||||
aliases: &aliases,
|
||||
})
|
||||
.expect("failed serde conversion")
|
||||
// All these `replace` calls are because we have to go through JS string for JSON content.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue