Skip to content

Commit

Permalink
Update search-result-impl-disambiguation.goml
Browse files Browse the repository at this point in the history
  • Loading branch information
notriddle committed Sep 21, 2023
1 parent 20b93b9 commit 2a4c9d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@ function preLoadCss(cssUrl) {
expandSection(pageId);
}
}
if (savedHash.startsWith("#impl-")) {
if (savedHash.startsWith("impl-")) {
// impl-disambiguated links, used by the search engine
// format: impl-X[-for-Y]/method.WHATEVER
// turn this into method.WHATEVER[-NUMBER]
const splitAt = savedHash.indexOf("/");
if (splitAt !== -1) {
const implId = savedHash.slice(1, splitAt);
const implId = savedHash.slice(0, splitAt);
const assocId = savedHash.slice(splitAt + 1);
const implElem = document.getElementById(implId);
if (implElem && implElem.parentElement.tagName === "SUMMARY" &&
Expand Down
4 changes: 2 additions & 2 deletions tests/rustdoc-gui/search-result-impl-disambiguation.goml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

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

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

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

0 comments on commit 2a4c9d0

Please sign in to comment.