diff options
author | Kartikaya Gupta <kats@seldon.staktrace.com> | 2016-10-02 15:57:26 -0400 |
---|---|---|
committer | Kartikaya Gupta <kats@seldon.staktrace.com> | 2016-10-02 15:57:26 -0400 |
commit | fe752e6434cdf75c00600d657855b43caf1927c0 (patch) | |
tree | acfa45506fd21655a498be2dce39bf1d264a069a /README.md | |
parent | e3c0114833d796d8ee2880292335363507ab2d1f (diff) |
Update main examples to include a dateparse usage
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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("<html>")); + assert_eq!(dateparse(parsed.headers.get_first_value("Date").unwrap().unwrap().as_str()).unwrap(), 1475417182); ``` Documentation |