Skip to content

Commit 12fb1d7

Browse files
feat: Add a impl From<http::HeaderName> for Vary (#210)
1 parent 66371a0 commit 12fb1d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/common/vary.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use http::HeaderValue;
1+
use http::{HeaderName, HeaderValue};
22

33
use crate::util::FlatCsv;
44

@@ -53,6 +53,12 @@ impl Vary {
5353
}
5454
}
5555

56+
impl From<HeaderName> for Vary {
57+
fn from(name: HeaderName) -> Self {
58+
Vary(HeaderValue::from(name).into())
59+
}
60+
}
61+
5662
/*
5763
test_vary {
5864
test_header!(test1, vec![b"accept-encoding, accept-language"]);

0 commit comments

Comments
 (0)