Remove redundant example of BTreeSet::iter

This commit is contained in:
zica 2023-06-04 23:48:37 +08:00 committed by GitHub
parent a28e125b21
commit 5a6400b8b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1124,19 +1124,6 @@ pub fn drain_filter<'a, F>(&'a mut self, pred: F) -> DrainFilter<'a, T, F, A>
/// ```
/// use std::collections::BTreeSet;
///
/// let set = BTreeSet::from([1, 2, 3]);
/// let mut set_iter = set.iter();
/// assert_eq!(set_iter.next(), Some(&1));
/// assert_eq!(set_iter.next(), Some(&2));
/// assert_eq!(set_iter.next(), Some(&3));
/// assert_eq!(set_iter.next(), None);
/// ```
///
/// Values returned by the iterator are returned in ascending order:
///
/// ```
/// use std::collections::BTreeSet;
///
/// let set = BTreeSet::from([3, 1, 2]);
/// let mut set_iter = set.iter();
/// assert_eq!(set_iter.next(), Some(&1));