]> git.lizzy.rs Git - rust.git/commitdiff
core::iter::repeat_with: fix tests some more
authorMazdak Farrokhzad <twingoow@gmail.com>
Mon, 12 Feb 2018 08:15:13 +0000 (09:15 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Mon, 12 Feb 2018 08:15:13 +0000 (09:15 +0100)
src/libcore/tests/iter.rs

index f42970685f57c6faae9c25d49411245029c76056..4c33c8440a3d00e6193a550793c42b7b917d3b9e 100644 (file)
@@ -1565,11 +1565,11 @@ fn test_repeat_with_rev() {
     let mut curr = 1;
     let mut pow2 = repeat_with(|| { let tmp = curr; curr *= 2; tmp })
                     .rev().take(4);
-    assert_eq!(it.next(), Some(1));
-    assert_eq!(it.next(), Some(2));
-    assert_eq!(it.next(), Some(4));
-    assert_eq!(it.next(), Some(8));
-    assert_eq!(it.next(), None);
+    assert_eq!(pow2.next(), Some(1));
+    assert_eq!(pow2.next(), Some(2));
+    assert_eq!(pow2.next(), Some(4));
+    assert_eq!(pow2.next(), Some(8));
+    assert_eq!(pow2.next(), None);
 }
 
 #[test]