Skip to content

Commit 9b6c629

Browse files
authored
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.
1 parent 5aa467b commit 9b6c629

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/collections/vec1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ mod tests {
2020
#[test]
2121
fn test_array_and_vec_similarity() {
2222
let (a, v) = array_and_vec();
23-
assert!(a.iter().zip(v.iter()).all(|(x, y)| x == y));
23+
assert_eq!(a, v[..]);
2424
}
2525
}

0 commit comments

Comments
 (0)