@@ -3072,7 +3072,8 @@ impl<T> [T] {
3072
3072
}
3073
3073
3074
3074
/// Reorders the slice such that the element at `index` is at a sort-order position. All
3075
- /// elements before `index` will be `<=` to this value, and all elements after will be `>=` to it.
3075
+ /// elements before `index` will be `<=` to this value, and all elements after will be `>=` to
3076
+ /// it.
3076
3077
///
3077
3078
/// This reordering is unstable (i.e. any element that compares equal to the nth element may end
3078
3079
/// up at that position), in-place (i.e. does not allocate), and runs in *O*(*n*) time. This
@@ -3081,7 +3082,9 @@ impl<T> [T] {
3081
3082
/// Returns a triple that partitions the reordered slice:
3082
3083
///
3083
3084
/// * The unsorted subslice before `index`, whose elements all satisfy `x <= self[index]`.
3085
+ ///
3084
3086
/// * The element at `index`.
3087
+ ///
3085
3088
/// * The unsorted subslice after `index`, whose elements all satisfy `x >= self[index]`.
3086
3089
///
3087
3090
/// # Current implementation
@@ -3131,18 +3134,22 @@ impl<T> [T] {
3131
3134
}
3132
3135
3133
3136
/// Reorders the slice with a comparator function such that the element at `index` is at a
3134
- /// sort-order position. All elements before `index` will be `<=` to this value, and all elements
3135
- /// after will be `>=` to it, according to the comparator function.
3137
+ /// sort-order position. All elements before `index` will be `<=` to this value, and all
3138
+ /// elements after will be `>=` to it, according to the comparator function.
3136
3139
///
3137
3140
/// This reordering is unstable (i.e. any element that compares equal to the nth element may end
3138
3141
/// up at that position), in-place (i.e. does not allocate), and runs in *O*(*n*) time. This
3139
3142
/// function is also known as "kth element" in other libraries.
3140
3143
///
3141
3144
/// Returns a triple partitioning the reordered slice:
3142
3145
///
3143
- /// * The unsorted subslice before `index`, whose elements all satisfy `compare(x, self[index]).is_le()`.
3146
+ /// * The unsorted subslice before `index`, whose elements all satisfy
3147
+ /// `compare(x, self[index]).is_le()`.
3148
+ ///
3144
3149
/// * The element at `index`.
3145
- /// * The unsorted subslice after `index`, whose elements all satisfy `compare(x, self[index]).is_ge()`.
3150
+ ///
3151
+ /// * The unsorted subslice after `index`, whose elements all satisfy
3152
+ /// `compare(x, self[index]).is_ge()`.
3146
3153
///
3147
3154
/// # Current implementation
3148
3155
///
@@ -3196,8 +3203,8 @@ impl<T> [T] {
3196
3203
}
3197
3204
3198
3205
/// Reorders the slice with a key extraction function such that the element at `index` is at a
3199
- /// sort-order position. All elements before `index` will have keys `<=` to the key at `index`, and
3200
- /// all elements after will have keys `>=` to it.
3206
+ /// sort-order position. All elements before `index` will have keys `<=` to the key at `index`,
3207
+ /// and all elements after will have keys `>=` to it.
3201
3208
///
3202
3209
/// This reordering is unstable (i.e. any element that compares equal to the nth element may end
3203
3210
/// up at that position), in-place (i.e. does not allocate), and runs in *O*(*n*) time. This
@@ -3206,7 +3213,9 @@ impl<T> [T] {
3206
3213
/// Returns a triple partitioning the reordered slice:
3207
3214
///
3208
3215
/// * The unsorted subslice before `index`, whose elements all satisfy `f(x) <= f(self[index])`.
3216
+ ///
3209
3217
/// * The element at `index`.
3218
+ ///
3210
3219
/// * The unsorted subslice after `index`, whose elements all satisfy `f(x) >= f(self[index])`.
3211
3220
///
3212
3221
/// # Current implementation
@@ -3229,7 +3238,8 @@ impl<T> [T] {
3229
3238
/// ```
3230
3239
/// let mut v = [-5i32, 4, 1, -3, 2];
3231
3240
///
3232
- /// // Find the items `<=` to the absolute median, the absolute median itself, and the items `>=` to it.
3241
+ /// // Find the items `<=` to the absolute median, the absolute median itself, and the items
3242
+ /// // `>=` to it.
3233
3243
/// let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
3234
3244
///
3235
3245
/// assert!(lesser == [1, 2] || lesser == [2, 1]);
0 commit comments