Skip to content

Commit ae93e6e

Browse files
Small JS code improvements
1 parent 082e4ca commit ae93e6e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ window.initSearch = function(rawSearchIndex) {
112112
* @type {Array<Row>}
113113
*/
114114
let searchIndex;
115-
/**
116-
* @type {Array<string>}
117-
*/
118-
let searchWords = [];
119115
let currentResults;
120116
const ALIASES = {};
121117
const params = searchState.getQueryStringParams();
@@ -2118,7 +2114,10 @@ window.initSearch = function(rawSearchIndex) {
21182114
search(undefined, true);
21192115
}
21202116

2121-
searchWords = buildIndex(rawSearchIndex);
2117+
/**
2118+
* @type {Array<string>}
2119+
*/
2120+
const searchWords = buildIndex(rawSearchIndex);
21222121
registerSearchEvents();
21232122

21242123
function runSearchIfNeeded() {

src/librustdoc/html/static/js/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Local js definitions:
21
/* eslint-env es6 */
32
/* eslint no-var: "error" */
43
/* eslint prefer-const: "error" */
4+
// Local js definitions:
55
/* global getSettingValue, getVirtualKey, onEachLazy, updateLocalStorage, updateSystemTheme */
66
/* global addClass, removeClass */
77

0 commit comments

Comments
 (0)