feat(header): implement fmt::Display for several headers

Specifically, `CacheControl`, `Expect`, `Origin`, `Pragma`, `Prefer`,
`PreferenceApplied`, `ReferrerPolicy`, `StrictTransportSecurity`.
This commit is contained in:
Sean McArthur
2017-01-31 13:25:33 -08:00
parent b4b2fb782e
commit e9e7381ece
11 changed files with 77 additions and 17 deletions

View File

@@ -85,9 +85,8 @@ macro_rules! bench_header(
fn bench_format(b: &mut Bencher) {
let raw = $value.into();
let val: $ty = Header::parse_header(&raw).unwrap();
let fmt = ::header::HeaderFormatter(&val);
b.iter(|| {
format!("{}", fmt);
format!("{}", val);
});
}
}