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