Skip to content

Commit fddf012

Browse files
committed
Clarify documentation of slice sorting methods
1 parent 1c82bb2 commit fddf012

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

library/core/src/slice/mod.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -2100,9 +2100,11 @@ impl<T> [T] {
21002100
///
21012101
/// If the value is found then [`Result::Ok`] is returned, containing the
21022102
/// index of the matching element. If there are multiple matches, then any
2103-
/// one of the matches could be returned. If the value is not found then
2104-
/// [`Result::Err`] is returned, containing the index where a matching
2105-
/// element could be inserted while maintaining sorted order.
2103+
/// one of the matches could be returned. The index is chosen
2104+
/// deterministically, but is subject to change in future versions of Rust.
2105+
/// If the value is not found then [`Result::Err`] is returned, containing
2106+
/// the index where a matching element could be inserted while maintaining
2107+
/// sorted order.
21062108
///
21072109
/// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`].
21082110
///
@@ -2153,9 +2155,11 @@ impl<T> [T] {
21532155
///
21542156
/// If the value is found then [`Result::Ok`] is returned, containing the
21552157
/// index of the matching element. If there are multiple matches, then any
2156-
/// one of the matches could be returned. If the value is not found then
2157-
/// [`Result::Err`] is returned, containing the index where a matching
2158-
/// element could be inserted while maintaining sorted order.
2158+
/// one of the matches could be returned. The index is chosen
2159+
/// deterministically, but is subject to change in future versions of Rust.
2160+
/// If the value is not found then [`Result::Err`] is returned, containing
2161+
/// the index where a matching element could be inserted while maintaining
2162+
/// sorted order.
21592163
///
21602164
/// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`].
21612165
///
@@ -2224,9 +2228,11 @@ impl<T> [T] {
22242228
///
22252229
/// If the value is found then [`Result::Ok`] is returned, containing the
22262230
/// index of the matching element. If there are multiple matches, then any
2227-
/// one of the matches could be returned. If the value is not found then
2228-
/// [`Result::Err`] is returned, containing the index where a matching
2229-
/// element could be inserted while maintaining sorted order.
2231+
/// one of the matches could be returned. The index is chosen
2232+
/// deterministically, but is subject to change in future versions of Rust.
2233+
/// If the value is not found then [`Result::Err`] is returned, containing
2234+
/// the index where a matching element could be inserted while maintaining
2235+
/// sorted order.
22302236
///
22312237
/// See also [`binary_search`], [`binary_search_by`], and [`partition_point`].
22322238
///

0 commit comments

Comments
 (0)