From fe752e6434cdf75c00600d657855b43caf1927c0 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Sun, 2 Oct 2016 15:57:26 -0400 Subject: Update main examples to include a dateparse usage --- README.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index cb482d0..2eabe64 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Example usage let parsed = parse_mail(concat!( "Subject: This is a test email\n", "Content-Type: multipart/alternative; boundary=foobar\n", + "Date: Sun, 02 Oct 2016 07:06:22 -0700 (PDT)\n", "\n", "--foobar\n", "Content-Type: text/plain; charset=utf-8\n", @@ -49,6 +50,7 @@ Example usage assert_eq!(parsed.subparts[1].headers[1].get_value().unwrap(), "base64"); assert_eq!(parsed.subparts[1].ctype.mimetype, "text/html"); assert!(parsed.subparts[1].get_body().unwrap().starts_with("")); + assert_eq!(dateparse(parsed.headers.get_first_value("Date").unwrap().unwrap().as_str()).unwrap(), 1475417182); ``` Documentation -- cgit v1.2.3