diff options
| author | Lionel Foxcroft <lionelf329@gmail.com> | 2021-06-04 01:27:19 -0400 |
|---|---|---|
| committer | Lionel Foxcroft <lionelf329@gmail.com> | 2021-06-07 16:50:08 -0400 |
| commit | fddf012177671110caa96c4d9036199a0b91b8e7 (patch) | |
| tree | aeeb11f1851ab792a4ef521268ef0b21deb28c03 | |
| parent | 1c82bb293c83877b52380d0d7a181a011fb70603 (diff) | |
| download | rust-fddf012177671110caa96c4d9036199a0b91b8e7.tar.gz rust-fddf012177671110caa96c4d9036199a0b91b8e7.zip | |
Clarify documentation of slice sorting methods
| -rw-r--r-- | library/core/src/slice/mod.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 3bcea4e6d25..0e5c5ee726e 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -2100,9 +2100,11 @@ impl<T> [T] { /// /// If the value is found then [`Result::Ok`] is returned, containing the /// index of the matching element. If there are multiple matches, then any - /// one of the matches could be returned. If the value is not found then - /// [`Result::Err`] is returned, containing the index where a matching - /// element could be inserted while maintaining sorted order. + /// one of the matches could be returned. The index is chosen + /// deterministically, but is subject to change in future versions of Rust. + /// If the value is not found then [`Result::Err`] is returned, containing + /// the index where a matching element could be inserted while maintaining + /// sorted order. /// /// See also [`binary_search_by`], [`binary_search_by_key`], and [`partition_point`]. /// @@ -2153,9 +2155,11 @@ impl<T> [T] { /// /// If the value is found then [`Result::Ok`] is returned, containing the /// index of the matching element. If there are multiple matches, then any - /// one of the matches could be returned. If the value is not found then - /// [`Result::Err`] is returned, containing the index where a matching - /// element could be inserted while maintaining sorted order. + /// one of the matches could be returned. The index is chosen + /// deterministically, but is subject to change in future versions of Rust. + /// If the value is not found then [`Result::Err`] is returned, containing + /// the index where a matching element could be inserted while maintaining + /// sorted order. /// /// See also [`binary_search`], [`binary_search_by_key`], and [`partition_point`]. /// @@ -2224,9 +2228,11 @@ impl<T> [T] { /// /// If the value is found then [`Result::Ok`] is returned, containing the /// index of the matching element. If there are multiple matches, then any - /// one of the matches could be returned. If the value is not found then - /// [`Result::Err`] is returned, containing the index where a matching - /// element could be inserted while maintaining sorted order. + /// one of the matches could be returned. The index is chosen + /// deterministically, but is subject to change in future versions of Rust. + /// If the value is not found then [`Result::Err`] is returned, containing + /// the index where a matching element could be inserted while maintaining + /// sorted order. /// /// See also [`binary_search`], [`binary_search_by`], and [`partition_point`]. /// |
