fn check_occurrences(occurrences: &[DateTime], expected: &[&str]) {
        let formater = |dt: &DateTime| -> String { format!("    \"{}\",\n", dt.to_rfc3339()) };
        println!(
            "Given: [\n{}]\nExpected: {:#?}",
            occurrences.iter().map(formater).collect::<String>(),
            expected
        );
        assert_eq!(occurrences.len(), expected.len(), "List sizes don't match");
        for (given, expected) in occurrences.iter().zip(expected.iter()) {
            let exp_datetime = chrono::DateTime::parse_from_rfc3339(expected).unwrap();
            // Compare items and check if in the same offset/timezone
            assert_eq!(
                given.to_rfc3339(),
                exp_datetime.to_rfc3339(),
                "Dates not in same timezone"
            );
        }
    }
/// Print and compare 2 lists of dates and panic it they are not the same.
Print and compare 2 lists of dates and panic it they are not the same.
Print and compare 2 lists of dates and panic it they are not the same .
fn check_occurrences(occurrences: &[DateTime], expected: &[&str]) {
        let formater = |dt: &DateTime| -> String { format!("    \"{}\",\n", dt.to_rfc3339()) };
        println!(
            "Given: [\n{}]\nExpected: {:#?}",
            occurrences.iter().map(formater).collect::<String>(),
            expected
        );
        assert_eq!(occurrences.len(), expected.len(), "List sizes don't match");
        for (given, expected) in occurrences.iter().zip(expected.iter()) {
            let exp_datetime = chrono::DateTime::parse_from_rfc3339(expected).unwrap();
            // Compare items and check if in the same offset/timezone
            assert_eq!(
                given.to_rfc3339(),
                exp_datetime.to_rfc3339(),
                "Dates not in same timezone"
            );
        }
    }
fn check_occurrences ( occurrences : & [ DateTime ] , expected : & [ & str ] ) { let formater = | dt : & DateTime | -> String { format ! ( " \" \" \n " dt to_rfc3339 ( ) ) } ; println ! ( " \n \n " occurrences iter ( ) map ( formater ) collect String ( ) expected ) ; assert_eq ! ( occurrences len ( ) expected len ( ) " " ) ; for ( given , expected ) in occurrences . iter ( ) . zip ( expected . iter ( ) ) { let exp_datetime = chrono :: DateTime :: parse_from_rfc3339 ( expected ) . unwrap ( ) ; // Compare items and check if in the same offset/timezone assert_eq ! ( given to_rfc3339 ( ) exp_datetime to_rfc3339 ( ) " " ) ; } }
Print and compare 2 lists of dates and panic it they are not the same.
Print and compare 2 lists of dates and panic it they are not the same .
occurrences
&[DateTime]
expected
&[&str]
occurrences
&[DateTime]
expected
&[&str]