Skip to content

Commit d09f04f

Browse files
committed
Fix ci check
1 parent 38a8a77 commit d09f04f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/librustdoc/html/static/js/search-core.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced
88
if (!Array.prototype.toSpliced) {
99
// Can't use arrow functions, because we want `this`
10-
Array.prototype.toSpliced = function () {
10+
Array.prototype.toSpliced = function() {
1111
const me = this.slice();
1212
Array.prototype.splice.apply(me, arguments);
1313
return me;
@@ -1185,6 +1185,10 @@ class DocSearch {
11851185
this.searchIndex = this.buildIndex(rawSearchIndex);
11861186
}
11871187

1188+
static getItemType(ty) {
1189+
return itemTypes[ty];
1190+
}
1191+
11881192
/**
11891193
* Add an item to the type Name->ID map, or, if one already exists, use it.
11901194
* Returns the number. If name is "" or null, return null (pure generic).
@@ -3135,9 +3139,9 @@ class DocSearch {
31353139
*/
31363140
const convertNameToId = (elem, isAssocType) => {
31373141
const loweredName = elem.pathLast.toLowerCase();
3138-
if (typeNameIdMap.has(loweredName) &&
3139-
(isAssocType || !typeNameIdMap.get(loweredName).assocOnly)) {
3140-
elem.id = typeNameIdMap.get(loweredName).id;
3142+
if (this.typeNameIdMap.has(loweredName) &&
3143+
(isAssocType || !this.typeNameIdMap.get(loweredName).assocOnly)) {
3144+
elem.id = this.typeNameIdMap.get(loweredName).id;
31413145
} else if (!parsedQuery.literalSearch) {
31423146
let match = null;
31433147
let matchDist = maxEditDistance + 1;

0 commit comments

Comments
 (0)