Skip to content

Commit

Permalink
Rustdoc Search: Increase Relevance of Primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed May 22, 2015
1 parent a713867 commit 94b6ddc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustdoc/html/static/main.js
Expand Up @@ -36,6 +36,9 @@
"constant",
"associatedconstant"];

// used for special search precedence
var TY_PRIMITIVE = itemTypes.indexOf("primitive");

$('.js-only').removeClass('js-only');

function getQueryStringParams() {
Expand Down Expand Up @@ -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 === '');
Expand Down

0 comments on commit 94b6ddc

Please sign in to comment.