From 494f7fddd97a756874ad8b5eb02637f30c5a9e4f Mon Sep 17 00:00:00 2001 From: Ken Hoover Date: Sun, 13 Oct 2024 21:15:25 -0700 Subject: [PATCH] cleanup: Use copied and all in tests --- src/local/room_coordinate.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/local/room_coordinate.rs b/src/local/room_coordinate.rs index bd18e605..9e3167ac 100644 --- a/src/local/room_coordinate.rs +++ b/src/local/room_coordinate.rs @@ -239,8 +239,9 @@ mod test { base[coord] += 1; } base.iter() + .copied() .zip(1..51) - .for_each(|(&actual, expected)| assert_eq!(actual, expected)); + .for_each(|(actual, expected)| assert_eq!(actual, expected)); } #[test] @@ -254,7 +255,7 @@ mod test { for i in 0..ROOM_SIZE { let coord = RoomCoordinate::new(i).unwrap(); - assert_eq!(base[coord], [i; 50]); + assert!(base[coord].iter().copied().all(|val| val == i)); base[coord][0] += 1; }