diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-14 13:06:05 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-14 13:06:05 +0200 |
| commit | a195cf63b88ecfccebeae59e150a65ec5732779b (patch) | |
| tree | d93fc395ede7f1c50a46bf8205686bfb6c2ea54d /src/librustdoc/html/static/js | |
| parent | 2820fcc8302d25acdefbcfd4351831441dc177c6 (diff) | |
| download | rust-a195cf63b88ecfccebeae59e150a65ec5732779b.tar.gz rust-a195cf63b88ecfccebeae59e150a65ec5732779b.zip | |
Revert "rustdoc search: prefer stable items in search results"
This reverts commit 1140e90074b0cbcfdea8535e4b51877e2838227e.
Diffstat (limited to 'src/librustdoc/html/static/js')
| -rw-r--r-- | src/librustdoc/html/static/js/rustdoc.d.ts | 5 | ||||
| -rw-r--r-- | src/librustdoc/html/static/js/search.js | 21 |
2 files changed, 2 insertions, 24 deletions
diff --git a/src/librustdoc/html/static/js/rustdoc.d.ts b/src/librustdoc/html/static/js/rustdoc.d.ts index b082b65ab57..3d30a7adb98 100644 --- a/src/librustdoc/html/static/js/rustdoc.d.ts +++ b/src/librustdoc/html/static/js/rustdoc.d.ts @@ -129,7 +129,7 @@ declare namespace rustdoc { /** * A single parsed "atom" in a search query. For example, - * + * * std::fmt::Formatter, Write -> Result<()> * ┏━━━━━━━━━━━━━━━━━━ ┌──── ┏━━━━━┅┅┅┅┄┄┄┄┄┄┄┄┄┄┄┄┄┄┐ * ┃ │ ┗ QueryElement { ┊ @@ -449,8 +449,6 @@ declare namespace rustdoc { * of `p`) but is used for modules items like free functions. * * `c` is an array of item indices that are deprecated. - * - * `u` is an array of item indices that are unstable. */ type RawSearchIndexCrate = { doc: string, @@ -465,7 +463,6 @@ declare namespace rustdoc { p: Array<[number, string] | [number, string, number] | [number, string, number, number] | [number, string, number, number, string]>, b: Array<[number, String]>, c: string, - u: string, r: Array<[number, number]>, P: Array<[number, string]>, }; diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 516e857ee76..505652c0f4a 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -1465,11 +1465,6 @@ class DocSearch { */ this.searchIndexEmptyDesc = new Map(); /** - * @type {Map<String, RoaringBitmap>} - */ - this.searchIndexUnstable = new Map(); - - /** * @type {Uint32Array} */ this.functionTypeFingerprint = new Uint32Array(0); @@ -2057,10 +2052,9 @@ class DocSearch { }; const descShardList = [descShard]; - // Deprecated and unstable items and items with no description + // Deprecated items and items with no description this.searchIndexDeprecated.set(crate, new RoaringBitmap(crateCorpus.c)); this.searchIndexEmptyDesc.set(crate, new RoaringBitmap(crateCorpus.e)); - this.searchIndexUnstable.set(crate, new RoaringBitmap(crateCorpus.u)); let descIndex = 0; /** @@ -3332,19 +3326,6 @@ class DocSearch { return a - b; } - // sort unstable items later - a = Number( - // @ts-expect-error - this.searchIndexUnstable.get(aaa.item.crate).contains(aaa.item.bitIndex), - ); - b = Number( - // @ts-expect-error - this.searchIndexUnstable.get(bbb.item.crate).contains(bbb.item.bitIndex), - ); - if (a !== b) { - return a - b; - } - // sort by crate (current crate comes first) a = Number(aaa.item.crate !== preferredCrate); b = Number(bbb.item.crate !== preferredCrate); |
