rustdoc: bug fix for -> option<t>
This commit is contained in:
parent
b6bb06ca5d
commit
89a4c7f552
3 changed files with 11 additions and 1 deletions
|
@ -37,6 +37,7 @@ let ParserState;
|
||||||
* args: Array<QueryElement>,
|
* args: Array<QueryElement>,
|
||||||
* returned: Array<QueryElement>,
|
* returned: Array<QueryElement>,
|
||||||
* foundElems: number,
|
* foundElems: number,
|
||||||
|
* totalElems: number,
|
||||||
* literalSearch: boolean,
|
* literalSearch: boolean,
|
||||||
* corrections: Array<{from: string, to: integer}>,
|
* corrections: Array<{from: string, to: integer}>,
|
||||||
* }}
|
* }}
|
||||||
|
|
|
@ -973,6 +973,8 @@ function initSearch(rawSearchIndex) {
|
||||||
returned: [],
|
returned: [],
|
||||||
// Total number of "top" elements (does not include generics).
|
// Total number of "top" elements (does not include generics).
|
||||||
foundElems: 0,
|
foundElems: 0,
|
||||||
|
// Total number of elements (includes generics).
|
||||||
|
totalElems: 0,
|
||||||
literalSearch: false,
|
literalSearch: false,
|
||||||
error: null,
|
error: null,
|
||||||
correction: null,
|
correction: null,
|
||||||
|
@ -1074,6 +1076,7 @@ function initSearch(rawSearchIndex) {
|
||||||
query.literalSearch = parserState.totalElems > 1;
|
query.literalSearch = parserState.totalElems > 1;
|
||||||
}
|
}
|
||||||
query.foundElems = query.elems.length + query.returned.length;
|
query.foundElems = query.elems.length + query.returned.length;
|
||||||
|
query.totalElems = parserState.totalElems;
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1980,7 +1983,7 @@ function initSearch(rawSearchIndex) {
|
||||||
}
|
}
|
||||||
elem.id = match;
|
elem.id = match;
|
||||||
}
|
}
|
||||||
if ((elem.id === null && parsedQuery.foundElems > 1 && elem.typeFilter === -1)
|
if ((elem.id === null && parsedQuery.totalElems > 1 && elem.typeFilter === -1)
|
||||||
|| elem.typeFilter === TY_GENERIC) {
|
|| elem.typeFilter === TY_GENERIC) {
|
||||||
if (genericSymbols.has(elem.name)) {
|
if (genericSymbols.has(elem.name)) {
|
||||||
elem.id = genericSymbols.get(elem.name);
|
elem.id = genericSymbols.get(elem.name);
|
||||||
|
|
|
@ -72,4 +72,10 @@ const EXPECTED = [
|
||||||
{ 'path': 'std::option::Option', 'name': 'flatten' },
|
{ 'path': 'std::option::Option', 'name': 'flatten' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'query': 'option<t>',
|
||||||
|
'returned': [
|
||||||
|
{ 'path': 'std::result::Result', 'name': 'ok' },
|
||||||
|
],
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue