about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-03-15 11:58:34 -0700
committerMichael Howell <michael@notriddle.com>2021-03-15 11:58:34 -0700
commitdcba95f43ee7b3d7a282f4d96f98d3a1deeafcd2 (patch)
treebf4636212d45ebe0ac3084cfd74c31f8f3537161 /src
parent8eba927a3e732ee3bf992ac31d587294f81e8c46 (diff)
downloadrust-dcba95f43ee7b3d7a282f4d96f98d3a1deeafcd2.tar.gz
rust-dcba95f43ee7b3d7a282f4d96f98d3a1deeafcd2.zip
Declare `word` outside the loop, as recommended by eslint
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index fe1791e4b07..0a63fc589ae 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -1836,7 +1836,7 @@ function defocusSearchBar() {
         function buildIndex(rawSearchIndex) {
             searchIndex = [];
             var searchWords = [];
-            var i;
+            var i, word;
             var currentIndex = 0;
             var id = 0;
 
@@ -1905,10 +1905,10 @@ function defocusSearchBar() {
                     // This object should have exactly the same set of fields as the "crateRow"
                     // object defined above.
                     if (typeof itemNames[i] === "string") {
-                        var word = itemNames[i].toLowerCase();
+                        word = itemNames[i].toLowerCase();
                         searchWords.push(word);
                     } else {
-                        var word = "";
+                        word = "";
                         searchWords.push("");
                     }
                     var normalizedName = word.indexOf("_") === -1