Skip to content

Commit 934a194

Browse files
committed
fixed test_short_circuiting
1 parent 1ba1ca7 commit 934a194

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/core/tests/iter/traits/iterator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,10 @@ fn test_edge_case_handling_iterator_with_duplicates() {
641641
/// Tests that short-circuiting works correctly when using `has_item`
642642
/// When you run the function, it should move the iterator forward after the first appearance of the item
643643
fn test_short_circuiting() {
644-
let mut iterator = vec![1, 2, 3, 1, 1].into_iter();
644+
let vector = vec![1, 2, 3, 1, 1];
645+
let mut iterator = vector.iter();
645646
assert!(iterator.has_item(&1));
646-
assert_eq!(iterator.next(), Some(2));
647+
assert_eq!(iterator.next(), Some(&2));
647648
assert!(!iterator.has_item(&4));
648649
assert_eq!(iterator.next(), None);
649650
}

0 commit comments

Comments
 (0)