From 9b6c629397b24b944f484f5b2bbd8144266b5695 Mon Sep 17 00:00:00 2001 From: Jacob Tinkhauser <75188781+tinkhauser@users.noreply.github.com> Date: Sun, 29 Nov 2020 01:35:14 +0000 Subject: [PATCH] fix(vec1): Have test compare every element in a and v The previous test would stop comparing elements in array a and vec v upon reaching the last element of either. This resulted in the test passing even if v did not contain all the elements in a. This change to the test fixes that bug and should only pass if all the elements in a and v are present and equal. --- exercises/collections/vec1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/collections/vec1.rs b/exercises/collections/vec1.rs index ac3d9f1..f6bc837 100644 --- a/exercises/collections/vec1.rs +++ b/exercises/collections/vec1.rs @@ -20,6 +20,6 @@ mod tests { #[test] fn test_array_and_vec_similarity() { let (a, v) = array_and_vec(); - assert!(a.iter().zip(v.iter()).all(|(x, y)| x == y)); + assert_eq!(a, v[..]); } }