summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorKartikaya Gupta <kats@seldon.staktrace.com>2016-10-02 15:57:26 -0400
committerKartikaya Gupta <kats@seldon.staktrace.com>2016-10-02 15:57:26 -0400
commitfe752e6434cdf75c00600d657855b43caf1927c0 (patch)
treeacfa45506fd21655a498be2dce39bf1d264a069a /README.md
parente3c0114833d796d8ee2880292335363507ab2d1f (diff)
Update main examples to include a dateparse usage
Diffstat (limited to 'README.md')
-rw-r--r--README.md2
1 files changed, 2 insertions, 0 deletions
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("<html>"));
+ assert_eq!(dateparse(parsed.headers.get_first_value("Date").unwrap().unwrap().as_str()).unwrap(), 1475417182);
```
Documentation