]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: Don't include the path for primitive methods in the search results
authorOliver Middleton <olliemail27@gmail.com>
Sat, 13 Aug 2016 14:54:14 +0000 (15:54 +0100)
committerOliver Middleton <olliemail27@gmail.com>
Sat, 13 Aug 2016 14:57:44 +0000 (15:57 +0100)
Displaying `std::u32::max_value` is misleading so just display
`u32::max_value`.

src/librustdoc/html/static/main.js

index 0223475be4eb62dc22554b00a023b102b270e87f..de7e4d2483b4336b2b95fbb7dca2225451dda601 100644 (file)
                     } 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 {