File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -4587,18 +4587,16 @@ class DocSearch {
4587
4587
// types with generic parameters go last.
4588
4588
// That's because of the way unification is structured: it eats off
4589
4589
// the end, and hits a fast path if the last item is a simple atom.
4590
- // @ts -expect-error
4590
+ /** @type { function(rustdoc.QueryElement, rustdoc.QueryElement): number } */
4591
4591
const sortQ = ( a , b ) => {
4592
4592
const ag = a . generics . length === 0 && a . bindings . size === 0 ;
4593
4593
const bg = b . generics . length === 0 && b . bindings . size === 0 ;
4594
4594
if ( ag !== bg ) {
4595
- // @ts -expect-error
4596
- return ag - bg ;
4595
+ return + ag - + bg ;
4597
4596
}
4598
- const ai = a . id > 0 ;
4599
- const bi = b . id > 0 ;
4600
- // @ts -expect-error
4601
- return ai - bi ;
4597
+ const ai = a . id !== null && a . id > 0 ;
4598
+ const bi = b . id !== null && b . id > 0 ;
4599
+ return + ai - + bi ;
4602
4600
} ;
4603
4601
parsedQuery . elems . sort ( sortQ ) ;
4604
4602
parsedQuery . returned . sort ( sortQ ) ;
You can’t perform that action at this time.
0 commit comments