Skip to content

Commit 616b101

Browse files
committed
rustdoc: Don't include the path for primitive methods in the search results
Displaying `std::u32::max_value` is misleading so just display `u32::max_value`.
1 parent 5940150 commit 616b101

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustdoc/html/static/main.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,14 @@
587587
} else if (item.parent !== undefined) {
588588
var myparent = item.parent;
589589
var anchor = '#' + type + '.' + name;
590-
displayPath = item.path + '::' + myparent.name + '::';
590+
var parentType = itemTypes[myparent.ty];
591+
if (parentType === "primitive") {
592+
displayPath = myparent.name + '::';
593+
} else {
594+
displayPath = item.path + '::' + myparent.name + '::';
595+
}
591596
href = rootPath + item.path.replace(/::/g, '/') +
592-
'/' + itemTypes[myparent.ty] +
597+
'/' + parentType +
593598
'.' + myparent.name +
594599
'.html' + anchor;
595600
} else {

0 commit comments

Comments
 (0)