@@ -79,10 +79,10 @@ pub trait Iterator {
79
79
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
80
80
fn next ( & mut self ) -> Option < Self :: Item > ;
81
81
82
- /// Advances the iterator and returns an array has_iteming the next `N` values.
82
+ /// Advances the iterator and returns an array containing the next `N` values.
83
83
///
84
84
/// If there are not enough elements to fill the array then `Err` is returned
85
- /// has_iteming an iterator over the remaining elements.
85
+ /// containing an iterator over the remaining elements.
86
86
///
87
87
/// # Examples
88
88
///
@@ -1327,7 +1327,7 @@ pub trait Iterator {
1327
1327
/// `take(n)` yields elements until `n` elements are yielded or the end of
1328
1328
/// the iterator is reached (whichever happens first).
1329
1329
/// The returned iterator is a prefix of length `n` if the original iterator
1330
- /// has_items at least `n` elements, otherwise it has_items all of the
1330
+ /// contains at least `n` elements, otherwise it containss all of the
1331
1331
/// (fewer than `n`) elements of the original iterator.
1332
1332
///
1333
1333
/// # Examples
@@ -3356,7 +3356,7 @@ pub trait Iterator {
3356
3356
Rev :: new ( self )
3357
3357
}
3358
3358
3359
- /// Converts an iterator of pairs into a pair of has_itemers .
3359
+ /// Converts an iterator of pairs into a pair of containsers .
3360
3360
///
3361
3361
/// `unzip()` consumes an entire iterator of pairs, producing two
3362
3362
/// collections: one from the left elements of the pairs, and one
@@ -4062,7 +4062,7 @@ pub trait Iterator {
4062
4062
}
4063
4063
4064
4064
/// Checks if the Iterator has a value.
4065
- /// 'has_items ' is short-circuiting; in other words, it will stop processing
4065
+ /// 'contains ' is short-circuiting; in other words, it will stop processing
4066
4066
/// as soon as the function finds the item in the Iterator.
4067
4067
///
4068
4068
/// Performance:
@@ -4071,28 +4071,28 @@ pub trait Iterator {
4071
4071
///
4072
4072
/// Example:
4073
4073
/// ```
4074
- /// #![feature(iter_has_item )]
4075
- /// assert!(![1i32, 2i32, 3i32].iter().has_item (&4i32));
4076
- /// assert!([Some(2i32), Option::<i32>::None].iter().has_item (&None));
4077
- /// assert!([Some(2i32), Option::<i32>::None].iter().has_item (&Some(2i32)));
4078
- /// assert!(!Vec::<i32>::new().iter().has_item (&1i32));
4079
- /// assert!([1i32, 2i32, 2i32, 3i32].iter().has_item (&2i32));
4074
+ /// #![feature(iter_contains )]
4075
+ /// assert!(![1i32, 2i32, 3i32].iter().contains (&4i32));
4076
+ /// assert!([Some(2i32), Option::<i32>::None].iter().contains (&None));
4077
+ /// assert!([Some(2i32), Option::<i32>::None].iter().contains (&Some(2i32)));
4078
+ /// assert!(!Vec::<i32>::new().iter().contains (&1i32));
4079
+ /// assert!([1i32, 2i32, 2i32, 3i32].iter().contains (&2i32));
4080
4080
/// #[derive(PartialEq)]
4081
4081
/// struct Item {
4082
4082
/// value: i32,
4083
4083
/// }
4084
- /// assert!([Item { value: 1i32 }, Item { value: 2i32 }].iter().has_item (&Item { value: 2i32 }));
4085
- /// assert!(["a", "b", "c"].iter().has_item (&"b".to_owned()));
4086
- /// assert!(!["a", "b", "c"].iter().has_item (&"d".to_owned()));
4087
- /// assert!(["a", "b", "c"].iter().has_item (&"b"));
4088
- /// assert!(!["a", "b", "c"].iter().has_item (&"d"));
4089
- /// assert!(["a".to_owned(), "b".to_owned(), "c".to_owned()].iter().has_item (&"b"));
4090
- /// assert!(!["a".to_owned(), "b".to_owned(), "c".to_owned()].iter().has_item (&"d"));
4091
- /// assert!((1..1000).has_item (500i32));
4092
- /// ```
4093
- ///
4094
- #[ unstable( feature = "iter_has_item " , reason = "new API" , issue = "127494" ) ]
4095
- fn has_item < Q : ?Sized > ( & mut self , item : Q ) -> bool
4084
+ /// assert!([Item { value: 1i32 }, Item { value: 2i32 }].iter().contains (&Item { value: 2i32 }));
4085
+ /// assert!(["a", "b", "c"].iter().contains (&"b".to_owned()));
4086
+ /// assert!(!["a", "b", "c"].iter().contains (&"d".to_owned()));
4087
+ /// assert!(["a", "b", "c"].iter().contains (&"b"));
4088
+ /// assert!(!["a", "b", "c"].iter().contains (&"d"));
4089
+ /// assert!(["a".to_owned(), "b".to_owned(), "c".to_owned()].iter().contains (&"b"));
4090
+ /// assert!(!["a".to_owned(), "b".to_owned(), "c".to_owned()].iter().contains (&"d"));
4091
+ /// assert!((1..1000).contains (500i32));
4092
+ /// ```
4093
+ ///
4094
+ #[ unstable( feature = "iter_contains " , reason = "new API" , issue = "127494" ) ]
4095
+ fn contains < Q : ?Sized > ( & mut self , item : Q ) -> bool
4096
4096
where
4097
4097
Q : PartialEq < Self :: Item > ,
4098
4098
Self : Sized ,
0 commit comments