Skip to content

Commit 2a4c9d0

Browse files
committed
Update search-result-impl-disambiguation.goml
1 parent 20b93b9 commit 2a4c9d0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/librustdoc/html/static/js/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,13 @@ function preLoadCss(cssUrl) {
354354
expandSection(pageId);
355355
}
356356
}
357-
if (savedHash.startsWith("#impl-")) {
357+
if (savedHash.startsWith("impl-")) {
358358
// impl-disambiguated links, used by the search engine
359359
// format: impl-X[-for-Y]/method.WHATEVER
360360
// turn this into method.WHATEVER[-NUMBER]
361361
const splitAt = savedHash.indexOf("/");
362362
if (splitAt !== -1) {
363-
const implId = savedHash.slice(1, splitAt);
363+
const implId = savedHash.slice(0, splitAt);
364364
const assocId = savedHash.slice(splitAt + 1);
365365
const implElem = document.getElementById(implId);
366366
if (implElem && implElem.parentElement.tagName === "SUMMARY" &&

Diff for: tests/rustdoc-gui/search-result-impl-disambiguation.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Checks that, if a type has two methods with the same name, they both get
44
// linked correctly.
5-
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
5+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
66

77
// This should link to the inherent impl
88
write: (".search-input", "ZyxwvutMethodDisambiguation -> bool")
@@ -22,7 +22,7 @@ assert-document-property: ({
2222
}, ENDS_WITH)
2323
assert: "section:target"
2424

25-
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
25+
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
2626

2727
// This should link to the trait impl
2828
write: (".search-input", "ZyxwvutMethodDisambiguation, usize -> usize")

0 commit comments

Comments
 (0)