@@ -137,7 +137,7 @@ pub trait Iterator {
137
137
///
138
138
/// ```
139
139
/// let a = [1, 2, 3, 4, 5];
140
- /// assert !(a.iter().last().unwrap() == &5);
140
+ /// assert_eq !(a.iter().last().unwrap(), &5);
141
141
/// ```
142
142
#[ inline]
143
143
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -155,8 +155,8 @@ pub trait Iterator {
155
155
/// ```
156
156
/// let a = [1, 2, 3, 4, 5];
157
157
/// let mut it = a.iter();
158
- /// assert !(it.nth(2).unwrap() == &3);
159
- /// assert !(it.nth(2) == None);
158
+ /// assert_eq !(it.nth(2).unwrap(), &3);
159
+ /// assert_eq !(it.nth(2), None);
160
160
/// ```
161
161
#[ inline]
162
162
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -545,8 +545,8 @@ pub trait Iterator {
545
545
/// let mut it = 0..10;
546
546
/// // sum the first five values
547
547
/// let partial_sum = it.by_ref().take(5).fold(0, |a, b| a + b);
548
- /// assert !(partial_sum == 10);
549
- /// assert !(it.next() == Some(5));
548
+ /// assert_eq !(partial_sum, 10);
549
+ /// assert_eq !(it.next(), Some(5));
550
550
/// ```
551
551
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
552
552
fn by_ref ( & mut self ) -> & mut Self where Self : Sized { self }
@@ -608,7 +608,7 @@ pub trait Iterator {
608
608
///
609
609
/// ```
610
610
/// let a = [1, 2, 3, 4, 5];
611
- /// assert !(a.iter().fold(0, |acc, &item| acc + item) == 15);
611
+ /// assert_eq !(a.iter().fold(0, |acc, &item| acc + item), 15);
612
612
/// ```
613
613
#[ inline]
614
614
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -773,7 +773,7 @@ pub trait Iterator {
773
773
///
774
774
/// ```
775
775
/// let a = [1, 2, 3, 4, 5];
776
- /// assert !(a.iter().max().unwrap() == &5);
776
+ /// assert_eq !(a.iter().max().unwrap(), &5);
777
777
/// ```
778
778
#[ inline]
779
779
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -796,7 +796,7 @@ pub trait Iterator {
796
796
///
797
797
/// ```
798
798
/// let a = [1, 2, 3, 4, 5];
799
- /// assert !(a.iter().min().unwrap() == &1);
799
+ /// assert_eq !(a.iter().min().unwrap(), &1);
800
800
/// ```
801
801
#[ inline]
802
802
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -834,13 +834,13 @@ pub trait Iterator {
834
834
/// assert_eq!(a.iter().min_max(), NoElements);
835
835
///
836
836
/// let a = [1];
837
- /// assert !(a.iter().min_max() == OneElement(&1));
837
+ /// assert_eq !(a.iter().min_max(), OneElement(&1));
838
838
///
839
839
/// let a = [1, 2, 3, 4, 5];
840
- /// assert !(a.iter().min_max() == MinMax(&1, &5));
840
+ /// assert_eq !(a.iter().min_max(), MinMax(&1, &5));
841
841
///
842
842
/// let a = [1, 1, 1, 1];
843
- /// assert !(a.iter().min_max() == MinMax(&1, &1));
843
+ /// assert_eq !(a.iter().min_max(), MinMax(&1, &1));
844
844
/// ```
845
845
#[ unstable( feature = "core" , reason = "return type may change" ) ]
846
846
fn min_max ( mut self ) -> MinMaxResult < Self :: Item > where Self : Sized , Self :: Item : Ord
@@ -1058,7 +1058,7 @@ pub trait Iterator {
1058
1058
///
1059
1059
/// let a = [1, 2, 3, 4, 5];
1060
1060
/// let mut it = a.iter().cloned();
1061
- /// assert !(it.sum::<i32>() == 15);
1061
+ /// assert_eq !(it.sum::<i32>(), 15);
1062
1062
/// ```
1063
1063
#[ unstable( feature="core" ) ]
1064
1064
fn sum < S =<Self as Iterator >:: Item > ( self ) -> S where
@@ -1078,9 +1078,9 @@ pub trait Iterator {
1078
1078
/// fn factorial(n: u32) -> u32 {
1079
1079
/// (1..).take_while(|&i| i <= n).product()
1080
1080
/// }
1081
- /// assert !(factorial(0) == 1);
1082
- /// assert !(factorial(1) == 1);
1083
- /// assert !(factorial(5) == 120);
1081
+ /// assert_eq !(factorial(0), 1);
1082
+ /// assert_eq !(factorial(1), 1);
1083
+ /// assert_eq !(factorial(5), 120);
1084
1084
/// ```
1085
1085
#[ unstable( feature="core" ) ]
1086
1086
fn product < P =<Self as Iterator >:: Item > ( self ) -> P where
0 commit comments