From 616b101e3fe8f66a70dd45248da5a3ab0b942ae6 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sat, 13 Aug 2016 15:54:14 +0100 Subject: [PATCH] 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`. --- src/librustdoc/html/static/main.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 0223475be4eb6..de7e4d2483b43 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 {