mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
rustdoc: Clarify construction of name for search index
This commit is contained in:
parent
7dd5ad282c
commit
2721e97c5d
@ -260,17 +260,20 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
|
||||
}
|
||||
|
||||
// Index this method for searching later on.
|
||||
if let Some(name) = item.name.or_else(|| {
|
||||
if item.is_stripped() {
|
||||
None
|
||||
} else if let clean::ImportItem(ref i) = *item.kind
|
||||
&& let clean::ImportKind::Simple(s) = i.kind
|
||||
{
|
||||
Some(s)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}) {
|
||||
let search_name = if !item.is_stripped() {
|
||||
item.name.or_else(|| {
|
||||
if let clean::ImportItem(ref i) = *item.kind
|
||||
&& let clean::ImportKind::Simple(s) = i.kind
|
||||
{
|
||||
Some(s)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
if let Some(name) = search_name {
|
||||
add_item_to_search_index(self.tcx, &mut self.cache, &item, name)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user