Skip to content

Commit e48086c

Browse files
committed
rustdoc: Fix implementors list javascript
* Use a different loop variable, `i` was already taken. This caused missing items in the implementors list. * Use `.getAttribute('href')` rather than `.href` to get the relative URL which is what it needs to actually fix the links.
1 parent 9f15631 commit e48086c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/html/static/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,10 @@
10831083
code.innerHTML = structs[j];
10841084

10851085
var x = code.getElementsByTagName('a');
1086-
for (var i = 0; i < x.length; i++) {
1087-
var href = x[i].href;
1086+
for (var k = 0; k < x.length; k++) {
1087+
var href = x[k].getAttribute('href');
10881088
if (href && href.indexOf('http') !== 0) {
1089-
x[i].href = rootPath + href;
1089+
x[k].setAttribute('href', rootPath + href);
10901090
}
10911091
}
10921092
var li = document.createElement('li');

0 commit comments

Comments
 (0)