@@ -618,23 +618,23 @@ fn test_next_chunk() {
618
618
}
619
619
#[ test]
620
620
fn test_happy_path_item_not_in_iterator ( ) {
621
- assert ! ( ![ 1 , 2 , 3 ] . iter( ) . contain( & 4 ) ) ;
621
+ assert ! ( ![ 1i32 , 2i32 , 3i32 ] . iter( ) . contain( & 4i32 ) ) ;
622
622
}
623
623
624
624
#[ test]
625
625
fn test_edge_case_handling_none_values ( ) {
626
- assert ! ( [ Some ( 2 ) , None ] . iter( ) . contain( & None ) ) ;
627
- assert ! ( [ Some ( 2 ) , None ] . iter( ) . contain( & Some ( 2 ) ) ) ;
626
+ assert ! ( [ Some ( 2i32 ) , Option :: < i32 > :: None ] . iter( ) . contain( & None ) ) ;
627
+ assert ! ( [ Some ( 2i32 ) , Option :: < i32 > :: None ] . iter( ) . contain( & Some ( 2i32 ) ) ) ;
628
628
}
629
629
630
630
#[ test]
631
631
fn test_edge_case_handling_empty_iterator ( ) {
632
- assert ! ( !Vec :: <i32 >:: new( ) . iter( ) . contain( & 1 ) ) ;
632
+ assert ! ( !Vec :: <i32 >:: new( ) . iter( ) . contain( & 1i32 ) ) ;
633
633
}
634
634
635
635
#[ test]
636
636
fn test_edge_case_handling_iterator_with_duplicates ( ) {
637
- assert ! ( [ 1 , 2 , 2 , 3 ] . iter( ) . contain( & 2 ) ) ;
637
+ assert ! ( [ 1i32 , 2i32 , 2i32 , 3i32 ] . iter( ) . contain( & 2i32 ) ) ;
638
638
}
639
639
640
640
#[ test]
@@ -643,14 +643,14 @@ fn test_edge_case_handling_iterator_with_custom_struct() {
643
643
struct Item {
644
644
value : i32 ,
645
645
}
646
- assert ! ( [ Item { value: 1 } , Item { value: 2 } ] . iter( ) . contain( & Item { value: 2 } ) ) ;
646
+ assert ! ( [ Item { value: 1i32 } , Item { value: 2i32 } ] . iter( ) . contain( & Item { value: 2i32 } ) ) ;
647
647
}
648
648
649
- // #[test]
650
- // fn test_str_iterator_contain_string() {
651
- // assert!(["a", "b", "c"].iter().contain("b".to_owned()));
652
- // assert!(!["a", "b", "c"].iter().contain("d".to_owned()));
653
- // }
649
+ #[ test]
650
+ fn test_str_iterator_contain_string ( ) {
651
+ assert ! ( [ "a" , "b" , "c" ] . iter( ) . contain( & "b" . to_owned( ) ) ) ;
652
+ assert ! ( ![ "a" , "b" , "c" ] . iter( ) . contain( & "d" . to_owned( ) ) ) ;
653
+ }
654
654
655
655
#[ test]
656
656
fn test_str_iterator_contain_string_slice ( ) {
@@ -660,14 +660,14 @@ fn test_str_iterator_contain_string_slice() {
660
660
661
661
#[ test]
662
662
fn test_string_iterator_contain_str_slice ( ) {
663
- assert ! ( [ "a" . to_owned( ) , "b" . to_owned( ) , "c" . to_owned( ) ] . iter( ) . contain( "b" ) ) ;
664
- assert ! ( ![ "a" . to_owned( ) , "b" . to_owned( ) , "c" . to_owned( ) ] . iter( ) . contain( "d" ) ) ;
663
+ assert ! ( [ "a" . to_owned( ) , "b" . to_owned( ) , "c" . to_owned( ) ] . iter( ) . contain( & "b" ) ) ;
664
+ assert ! ( ![ "a" . to_owned( ) , "b" . to_owned( ) , "c" . to_owned( ) ] . iter( ) . contain( & "d" ) ) ;
665
665
}
666
666
667
667
668
668
#[ test]
669
669
fn test_edge_case_handling_iterator_with_large_number_of_elements ( ) {
670
- assert ! ( ( 1 ..1000 ) . contain( 500 ) ) ;
670
+ assert ! ( ( 1 ..1000 ) . contain( 500i32 ) ) ;
671
671
}
672
672
673
673
0 commit comments