pub fn check_occurrences<S: AsRef<str> + Debug>(occurrences: &[DateTime<Tz>], expected: &[S]) {
    let formatter = |dt: &DateTime<Tz>| -> String { format!("    \"{}\",\n", dt.to_rfc3339()) };
    println!(
        "Given: [\n{}]\nExpected: {:#?}",
        occurrences.iter().map(formatter).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.as_ref()).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 .
pub fn check_occurrences<S: AsRef<str> + Debug>(occurrences: &[DateTime<Tz>], expected: &[S]) {
    let formatter = |dt: &DateTime<Tz>| -> String { format!("    \"{}\",\n", dt.to_rfc3339()) };
    println!(
        "Given: [\n{}]\nExpected: {:#?}",
        occurrences.iter().map(formatter).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.as_ref()).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"
        );
    }
}
pub fn check_occurrences < S : AsRef < str > + Debug > ( occurrences : & [ DateTime < Tz > ] , expected : & [ S ] ) { let formatter = | dt : & DateTime < Tz > | -> String { format ! ( " \" \" \n " dt to_rfc3339 ( ) ) } ; println ! ( " \n \n " occurrences iter ( ) map ( formatter ) 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 . as_ref ( ) ) . 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<Tz>]
expected
&[S]
occurrences
&[DateTime<Tz>]
expected
&[S]