Skip to content

Commit 3e3ccd8

Browse files
committed
fixed test_short_circuiting
1 parent 934a194 commit 3e3ccd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,11 @@ 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 vector = vec![1, 2, 3, 1, 1];
645-
let mut iterator = vector.iter();
646-
assert!(iterator.has_item(&1));
647-
assert_eq!(iterator.next(), Some(&2));
648-
assert!(!iterator.has_item(&4));
644+
let vector: Vec<i32> = vec![1i32, 2i32, 3i32, 1i32, 1i32];
645+
let mut iterator = vector.into_iter();
646+
assert!(iterator.has_item(1i32));
647+
assert_eq!(iterator.next(), Some(2));
648+
assert!(!iterator.has_item(4i32));
649649
assert_eq!(iterator.next(), None);
650650
}
651651

0 commit comments

Comments
 (0)