Skip to content

Commit

Permalink
Auto merge of #35655 - ollie27:rustdoc_search_static_prim, r=stevekla…
Browse files Browse the repository at this point in the history
…bnik

rustdoc: Fix a couple of issues with the search results

* Fix links to static items in the search results.
* 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`.
  • Loading branch information
bors committed Aug 19, 2016
2 parents 413ada3 + 616b101 commit f883b0b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,6 @@
displayPath = item.path + '::';
href = rootPath + item.path.replace(/::/g, '/') + '/' +
name + '/index.html';
} else if (type === 'static' || type === 'reexport') {
displayPath = item.path + '::';
href = rootPath + item.path.replace(/::/g, '/') +
'/index.html';
} else if (type === "primitive") {
displayPath = "";
href = rootPath + item.path.replace(/::/g, '/') +
Expand All @@ -591,9 +587,14 @@
} else if (item.parent !== undefined) {
var myparent = item.parent;
var anchor = '#' + type + '.' + name;
displayPath = item.path + '::' + myparent.name + '::';
var parentType = itemTypes[myparent.ty];
if (parentType === "primitive") {
displayPath = myparent.name + '::';
} else {
displayPath = item.path + '::' + myparent.name + '::';
}
href = rootPath + item.path.replace(/::/g, '/') +
'/' + itemTypes[myparent.ty] +
'/' + parentType +
'.' + myparent.name +
'.html' + anchor;
} else {
Expand Down

0 comments on commit f883b0b

Please sign in to comment.