fix: doc test
This commit is contained in:
parent
4c8ce48a15
commit
c9b4915705
1 changed files with 3 additions and 3 deletions
|
@ -2676,11 +2676,11 @@ impl<T> [T] {
|
|||
/// #![feature(partition_point)]
|
||||
///
|
||||
/// let v = [1, 2, 3, 3, 5, 6, 7];
|
||||
/// let i = xs.partition_point(|&x| x < 5);
|
||||
/// let i = v.partition_point(|&x| x < 5);
|
||||
///
|
||||
/// assert_eq!(i, 4);
|
||||
/// assert!(xs[..i].iter().all(|&x| x < 5));
|
||||
/// assert!(xs[i..].iter().all(|&x| !(x < 5)));
|
||||
/// assert!(v[..i].iter().all(|&x| x < 5));
|
||||
/// assert!(v[i..].iter().all(|&x| !(x < 5)));
|
||||
/// ```
|
||||
#[unstable(feature = "partition_point", reason = "new API", issue = "99999")]
|
||||
pub fn partition_point<P>(&self, mut pred: P) -> usize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue