Rustdoc Search: Increase Relevance of Primitives
This commit is contained in:
parent
a713867c74
commit
94b6ddc37c
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,9 @@
|
|||
"constant",
|
||||
"associatedconstant"];
|
||||
|
||||
// used for special search precedence
|
||||
var TY_PRIMITIVE = itemTypes.indexOf("primitive");
|
||||
|
||||
$('.js-only').removeClass('js-only');
|
||||
|
||||
function getQueryStringParams() {
|
||||
|
@ -322,6 +325,10 @@
|
|||
b = bbb.index;
|
||||
if (a !== b) { return a - b; }
|
||||
|
||||
// special precedence for primitive pages
|
||||
if ((aaa.item.ty === TY_PRIMITIVE) && (bbb.item.ty !== TY_PRIMITIVE)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// sort by description (no description goes later)
|
||||
a = (aaa.item.desc === '');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue