Function rfc822_sanitizer::parse_from_rfc2822_with_fallback
[−]
[src]
pub fn parse_from_rfc2822_with_fallback<'s, S: Into<Cow<'s, str>>>(
s: S
) -> ParseResult<DateTime<FixedOffset>>
Calls DateTime::parse_from_rfc2822()
. If it succedes returns,
Else it calls sanitize_rfc822_like_date
and retries.
Basic usage:
let bad_input = parse_from_rfc2822_with_fallback("Thu, 05 Aug 2016 06:00:00 -0400"); let correct_result = DateTime::parse_from_rfc2822("Fri, 05 Aug 2016 06:00:00 -0400"); assert_eq!(bad_input, correct_result);