rustdoc-search: make primitives and keywords less special
The search sorting code already sorts by item type discriminant, putting things with smaller discriminants first. There was also a special case for sorting keywords and primitives earlier, and this commit removes it by giving them lower discriminants. The sorting code has another criteria where items with descriptions appear earlier than items without, and that criteria has higher priority than the item type. This shouldn't matter, though, because primitives and keywords normally only appear in the standard library, and it always gives them descriptions.
This commit is contained in:
parent
d82a08537a
commit
28f17d97a9
9 changed files with 74 additions and 79 deletions
|
@ -43,16 +43,16 @@ const PARSED = [
|
|||
pathWithoutLast: [],
|
||||
pathLast: "[]",
|
||||
generics: [],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
@ -70,7 +70,7 @@ const PARSED = [
|
|||
pathWithoutLast: [],
|
||||
pathLast: "[]",
|
||||
generics: [],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
{
|
||||
name: "u8",
|
||||
|
@ -105,7 +105,7 @@ const PARSED = [
|
|||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
@ -140,7 +140,7 @@ const PARSED = [
|
|||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
@ -176,7 +176,7 @@ const PARSED = [
|
|||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
@ -194,7 +194,7 @@ const PARSED = [
|
|||
pathWithoutLast: [],
|
||||
pathLast: "[]",
|
||||
generics: [],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
@ -284,7 +284,7 @@ const PARSED = [
|
|||
typeFilter: -1,
|
||||
},
|
||||
],
|
||||
typeFilter: 15,
|
||||
typeFilter: 1,
|
||||
},
|
||||
],
|
||||
foundElems: 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue