diff options
| author | Alexis Bourget <alexis.bourget@gmail.com> | 2020-09-08 23:05:51 +0200 |
|---|---|---|
| committer | Alexis Bourget <alexis.bourget@gmail.com> | 2020-09-21 21:50:26 +0200 |
| commit | 85b2d9bf6f2b04ae8996050b2fb276bd58cd92de (patch) | |
| tree | a2868e0a400cf6a19c934839b985c12c87338270 | |
| parent | fc152cd67e0b6d3f11f49eae43183d03a3b8bf17 (diff) | |
| download | rust-85b2d9bf6f2b04ae8996050b2fb276bd58cd92de.tar.gz rust-85b2d9bf6f2b04ae8996050b2fb276bd58cd92de.zip | |
fmt
| -rw-r--r-- | library/core/tests/iter.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/library/core/tests/iter.rs b/library/core/tests/iter.rs index 6680205c26c..ab97352a806 100644 --- a/library/core/tests/iter.rs +++ b/library/core/tests/iter.rs @@ -379,7 +379,9 @@ fn test_zip_next_back_side_effects_exhausted() { #[derive(Debug)] struct CountClone(Cell<i32>); -fn count_clone() -> CountClone { CountClone(Cell::new(0)) } +fn count_clone() -> CountClone { + CountClone(Cell::new(0)) +} impl PartialEq<i32> for CountClone { fn eq(&self, rhs: &i32) -> bool { @@ -401,7 +403,7 @@ fn test_zip_cloned_sideffectful() { let xs = [count_clone(), count_clone(), count_clone(), count_clone()]; let ys = [count_clone(), count_clone()]; - for _ in xs.iter().cloned().zip(ys.iter().cloned()) { } + for _ in xs.iter().cloned().zip(ys.iter().cloned()) {} assert_eq!(&xs, &[1, 1, 1, 0][..]); assert_eq!(&ys, &[1, 1][..]); @@ -409,7 +411,7 @@ fn test_zip_cloned_sideffectful() { let xs = [count_clone(), count_clone()]; let ys = [count_clone(), count_clone(), count_clone(), count_clone()]; - for _ in xs.iter().cloned().zip(ys.iter().cloned()) { } + for _ in xs.iter().cloned().zip(ys.iter().cloned()) {} assert_eq!(&xs, &[1, 1][..]); assert_eq!(&ys, &[1, 1, 0, 0][..]); @@ -420,7 +422,7 @@ fn test_zip_map_sideffectful() { let mut xs = [0; 6]; let mut ys = [0; 4]; - for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) { } + for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) {} assert_eq!(&xs, &[1, 1, 1, 1, 1, 0]); assert_eq!(&ys, &[1, 1, 1, 1]); @@ -428,7 +430,7 @@ fn test_zip_map_sideffectful() { let mut xs = [0; 4]; let mut ys = [0; 6]; - for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) { } + for _ in xs.iter_mut().map(|x| *x += 1).zip(ys.iter_mut().map(|y| *y += 1)) {} assert_eq!(&xs, &[1, 1, 1, 1]); assert_eq!(&ys, &[1, 1, 1, 1, 0, 0]); |
