Skip to content

Commit af11a3d

Browse files
committed
Fix tidys
1 parent 9577284 commit af11a3d

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

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

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ function getFilteredNextElem(query, parserState, elems, isInGenerics) {
282282
}
283283

284284
/**
285-
* This function parses the next query element until it finds `endChar`,
285+
* This function parses the next query element until it finds `endChar`,
286286
* calling `getNextElem` to collect each element.
287287
*
288-
* If there is no `endChar`, this function will implicitly stop at the end
288+
* If there is no `endChar`, this function will implicitly stop at the end
289289
* without raising an error.
290290
*
291291
* @param {ParsedQuery} query
@@ -398,7 +398,7 @@ function getItemsBefore(query, parserState, elems, endChar) {
398398
if (endChar !== "" && parserState.pos >= parserState.length) {
399399
throw ["Unclosed ", extra];
400400
}
401-
// This case can be encountered if `getNextElem` encountered a "stop character"
401+
// This case can be encountered if `getNextElem` encountered a "stop character"
402402
// right from the start. For example if you have `,,` or `<>`. In this case,
403403
// we simply move up the current position to continue the parsing.
404404
if (posBefore === parserState.pos) {
@@ -750,7 +750,7 @@ function makePrimitiveElement(name, extra) {
750750
}
751751

752752
/**
753-
* If we encounter a `"`, then we try to extract the string
753+
* If we encounter a `"`, then we try to extract the string
754754
* from it until we find another `"`.
755755
*
756756
* This function will throw an error in the following cases:
@@ -787,8 +787,8 @@ function getStringElem(query, parserState, isInGenerics) {
787787
}
788788

789789
/**
790-
* This function goes through all characters until it reaches an invalid ident
791-
* character or the end of the query. It returns the position of the last
790+
* This function goes through all characters until it reaches an invalid ident
791+
* character or the end of the query. It returns the position of the last
792792
* character of the ident.
793793
*
794794
* @param {ParserState} parserState
@@ -1221,7 +1221,7 @@ class DocSearch {
12211221
* functions that operate on a small set of data types, so the search index compresses them
12221222
* by encoding function parameter and return types as indexes into an array of names.
12231223
*
1224-
* Even when a general-purpose compression algorithm is used, this is still a win.
1224+
* Even when a general-purpose compression algorithm is used, this is still a win.
12251225
* I checked. https://github.com/rust-lang/rust/pull/98475#issue-1284395985
12261226
*
12271227
* The format for individual function types is encoded in
@@ -1368,9 +1368,9 @@ class DocSearch {
13681368
/**
13691369
* Convert from RawFunctionSearchType to FunctionSearchType.
13701370
*
1371-
* Crates often have lots of functions in them, and function signatures are sometimes
1372-
* complex, so rustdoc uses a pretty tight encoding for them. This function converts it
1373-
* to a simpler, object-based encoding so that the actual search code is more readable
1371+
* Crates often have lots of functions in them, and function signatures are sometimes
1372+
* complex, so rustdoc uses a pretty tight encoding for them. This function converts it
1373+
* to a simpler, object-based encoding so that the actual search code is more readable
13741374
* and easier to debug.
13751375
*
13761376
* The raw function search type format is generated using serde in
@@ -1389,7 +1389,9 @@ class DocSearch {
13891389
const OUTPUT_DATA = 1;
13901390
let inputs, output;
13911391
if (typeof functionSearchType[INPUTS_DATA] === "number") {
1392-
inputs = [this.buildItemSearchType(functionSearchType[INPUTS_DATA], lowercasePaths)];
1392+
inputs = [
1393+
this.buildItemSearchType(functionSearchType[INPUTS_DATA], lowercasePaths)
1394+
];
13931395
} else {
13941396
inputs = this.buildItemSearchTypeAll(
13951397
functionSearchType[INPUTS_DATA],
@@ -1399,7 +1401,10 @@ class DocSearch {
13991401
if (functionSearchType.length > 1) {
14001402
if (typeof functionSearchType[OUTPUT_DATA] === "number") {
14011403
output = [
1402-
this.buildItemSearchType(functionSearchType[OUTPUT_DATA], lowercasePaths)
1404+
this.buildItemSearchType(
1405+
functionSearchType[OUTPUT_DATA],
1406+
lowercasePaths,
1407+
)
14031408
];
14041409
} else {
14051410
output = this.buildItemSearchTypeAll(
@@ -2722,7 +2727,8 @@ class DocSearch {
27222727
if (row.id > 0 && elem.id > 0 && elem.pathWithoutLast.length === 0 &&
27232728
typePassesFilter(elem.typeFilter, row.ty) && elem.generics.length === 0 &&
27242729
// special case
2725-
elem.id !== this.typeNameIdOfArrayOrSlice && elem.id !== this.typeNameIdOfTupleOrUnit
2730+
elem.id !== this.typeNameIdOfArrayOrSlice
2731+
&& elem.id !== this.typeNameIdOfTupleOrUnit
27262732
&& elem.id !== this.typeNameIdOfHof
27272733
) {
27282734
return row.id === elem.id || checkIfInList(
@@ -2826,7 +2832,8 @@ class DocSearch {
28262832
const aliases = [];
28272833
const crateAliases = [];
28282834
if (filterCrates !== null) {
2829-
if (this.ALIASES.has(filterCrates) && this.ALIASES.get(filterCrates).has(lowerQuery)) {
2835+
if (this.ALIASES.has(filterCrates)
2836+
&& this.ALIASES.get(filterCrates).has(lowerQuery)) {
28302837
const query_aliases = this.ALIASES.get(filterCrates).get(lowerQuery);
28312838
for (const alias of query_aliases) {
28322839
aliases.push(createAliasFromItem(this.searchIndex[alias]));

0 commit comments

Comments
 (0)