diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2016-08-13 15:54:14 +0100 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2016-08-13 15:57:44 +0100 |
| commit | 616b101e3fe8f66a70dd45248da5a3ab0b942ae6 (patch) | |
| tree | 6c0e284cfdc44ac44a1a6e389d18b6700f038c4b /src | |
| parent | 5940150841fab50c3a178b5ccc33ceff0b0b4545 (diff) | |
| download | rust-616b101e3fe8f66a70dd45248da5a3ab0b942ae6.tar.gz rust-616b101e3fe8f66a70dd45248da5a3ab0b942ae6.zip | |
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`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 0223475be4e..de7e4d2483b 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -587,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 { |
