From 42a5e14da5fdff58f9b668f7fc6fd6fd1b39f770 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Mon, 26 Dec 2016 09:14:43 -0500 Subject: Update documentation --- target/doc/mailparse/fn.parse_content_type.html | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'target/doc/mailparse/fn.parse_content_type.html') diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html index 7e4ed82..9470f28 100644 --- a/target/doc/mailparse/fn.parse_content_type.html +++ b/target/doc/mailparse/fn.parse_content_type.html @@ -47,8 +47,8 @@ [] - [src] -
pub fn parse_content_type(header: &str) -> Result<ParsedContentType, MailParseError>

Helper method to parse a header value as a Content-Type header. The charset + [src] +

pub fn parse_content_type(header: &str) -> Result<ParsedContentTypeMailParseError>

Helper method to parse a header value as a Content-Type header. The charset defaults to "us-ascii" if no charset parameter is provided in the header value.

@@ -61,7 +61,7 @@ value.

let ctype = parse_content_type(&parsed.get_value().unwrap()).unwrap(); assert_eq!(ctype.mimetype, "text/html"); assert_eq!(ctype.charset, "foo"); - assert_eq!(ctype.boundary, Some("quotes_are_removed".to_string())); + assert_eq!(ctype.boundary, Some("quotes_are_removed".to_string()));Run
     use mailparse::{parse_header, parse_content_type};
@@ -69,7 +69,16 @@ value.

let ctype = parse_content_type(&parsed.get_value().unwrap()).unwrap(); assert_eq!(ctype.mimetype, "bogus"); assert_eq!(ctype.charset, "us-ascii"); - assert_eq!(ctype.boundary, None);
+ assert_eq!(ctype.boundary, None);Run + +
+    use mailparse::{parse_header, parse_content_type};
+    let (parsed, _) = parse_header(br#"Content-Type: application/octet-stream;name="=?utf8?B?6L+O5ai255m95a+M576O?=";charset="utf8""#).unwrap();
+    let ctype = parse_content_type(&parsed.get_value().unwrap()).unwrap();
+    assert_eq!(ctype.mimetype, "application/octet-stream");
+    assert_eq!(ctype.charset, "utf8");
+    assert_eq!(ctype.boundary, None);
+    assert_eq!(ctype.name, Some("迎娶白富美".to_string()));Run
@@ -93,6 +102,8 @@ value.

Move down in search results
Go to active search result
+
+
+
Collapse/expand all sections
-- cgit v1.2.3