Function rfc822_sanitizer::parse_from_rfc2822_with_fallback [] [src]

pub fn parse_from_rfc2822_with_fallback(
    s: &str
) -> ParseResult<DateTime<FixedOffset>>

World is full of broken code and invalid rfc822/rfc2822 daytimes. Higher order function that does what you wanted not what you said! If it encounters an invalid daytime input it tries to fix it first.

This function acts like the normal DateTime::parse_from_rfc2822 would at first.

It calls DateTime::parse_from_rfc2822(s), if it succedes It returns the normal result.

But if It fails, It will try to sanitize the String s, and fix common ways date generators misshandle rfc822/rfc2822. Then try to parse it again as DayTime.

BEWARE OF THE PERFORMANCE PENALTIES.