about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/lib.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-05 06:37:13 +0100
committerGitHub <noreply@github.com>2024-02-05 06:37:13 +0100
commit7158b3d3fbae9d318b73fea261f2e3732491c7ee (patch)
tree79443c737b9f0957afc9257da5490cbf027b7801 /compiler/rustc_data_structures/src/lib.rs
parent991a9dc3f7f9aa4f56bbb7431e294ca52a34acfc (diff)
parent7ac4515dde285decf97985107f154bf9e08b4a7e (diff)
downloadrust-7158b3d3fbae9d318b73fea261f2e3732491c7ee.tar.gz
rust-7158b3d3fbae9d318b73fea261f2e3732491c7ee.zip
Rollup merge of #119481 - romanows:fix-doc-select-nth-unstable, r=Mark-Simulacrum
Clarify ambiguity in select_nth_unstable docs

Original docs for `select_nth_unstable` family of functions were ambiguous as to whether "the element at `index`" was the element at `index` before the function reordered the elements or after the function reordered the elements.

The most helpful change in this PR is to change the given examples to make this absolutely clear.  Before, "the element at `index`" was the same value before and after the reordering, so it didn't help disambiguate the meaning.  I've changed the example for `select_nth_unstable` and `select_nth_unstable_by` so that "the element at `index`" is different before and after the reordering, which clears up the ambiguity.  The function `select_nth_unstable_by_key` already had an example that was unambiguous.

In an attempt to clear up the ambiguity from the get-go, I've added a bit of redundancy to the text.  Now the docs refer to "the element at `index` *after the reordering*".
Diffstat (limited to 'compiler/rustc_data_structures/src/lib.rs')
0 files changed, 0 insertions, 0 deletions