1
Fork 0

Rustdoc Search: Increase Relevance of Primitives

This commit is contained in:
Pascal Hertleif 2015-05-22 14:15:35 +02:00
parent a713867c74
commit 94b6ddc37c

View file

@ -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 === '');