@@ -1174,9 +1174,10 @@ impl<T> [T] {
1174
1174
1175
1175
/// Binary searches this sorted slice for a given element.
1176
1176
///
1177
- /// If the value is found then `Ok` is returned, containing the
1178
- /// index of the matching element; if the value is not found then
1179
- /// `Err` is returned, containing the index where a matching
1177
+ /// If the value is found then [`Result::Ok`] is returned, containing the
1178
+ /// index of the matching element. If there are multiple matches, then any
1179
+ /// one of the matches could be returned. If the value is not found then
1180
+ /// [`Result::Err`] is returned, containing the index where a matching
1180
1181
/// element could be inserted while maintaining sorted order.
1181
1182
///
1182
1183
/// # Examples
@@ -1208,9 +1209,10 @@ impl<T> [T] {
1208
1209
/// order code that indicates whether its argument is `Less`,
1209
1210
/// `Equal` or `Greater` the desired target.
1210
1211
///
1211
- /// If a matching value is found then returns `Ok`, containing
1212
- /// the index for the matched element; if no match is found then
1213
- /// `Err` is returned, containing the index where a matching
1212
+ /// If the value is found then [`Result::Ok`] is returned, containing the
1213
+ /// index of the matching element. If there are multiple matches, then any
1214
+ /// one of the matches could be returned. If the value is not found then
1215
+ /// [`Result::Err`] is returned, containing the index where a matching
1214
1216
/// element could be inserted while maintaining sorted order.
1215
1217
///
1216
1218
/// # Examples
@@ -1264,10 +1266,11 @@ impl<T> [T] {
1264
1266
/// Assumes that the slice is sorted by the key, for instance with
1265
1267
/// [`sort_by_key`] using the same key extraction function.
1266
1268
///
1267
- /// If a matching value is found then returns `Ok`, containing the
1268
- /// index for the matched element; if no match is found then `Err`
1269
- /// is returned, containing the index where a matching element could
1270
- /// be inserted while maintaining sorted order.
1269
+ /// If the value is found then [`Result::Ok`] is returned, containing the
1270
+ /// index of the matching element. If there are multiple matches, then any
1271
+ /// one of the matches could be returned. If the value is not found then
1272
+ /// [`Result::Err`] is returned, containing the index where a matching
1273
+ /// element could be inserted while maintaining sorted order.
1271
1274
///
1272
1275
/// [`sort_by_key`]: #method.sort_by_key
1273
1276
///
0 commit comments