refactor(headers): Fail to parse single value header values

A single value header value can't be "", so `from_one_raw_str()` now
returns `None` on empty values. This makes custom checks in headers
obsolete.

BREAKING CHANGE: `from_one_raw_str()` returns `None` on empty values.
This commit is contained in:
Pyfisch
2015-05-02 16:40:53 +02:00
parent 6b59bd28b7
commit a6974c99d3
2 changed files with 7 additions and 3 deletions

View File

@@ -57,4 +57,6 @@ fn test_parse_header() {
let c: Pragma = Header::parse_header([b"FoObar".to_vec()].as_ref()).unwrap();
let d = Pragma::Ext("FoObar".to_string());
assert_eq!(c, d);
let e: Option<Pragma> = Header::parse_header([b"".to_vec()].as_ref());
assert_eq!(e, None);
}