Skip to content

Commit e089cf0

Browse files
authored
Merge pull request #240 from LukeMathWalker/contains
Add `contains` to `HeaderValues`.
2 parents a169d6b + abfc164 commit e089cf0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/headers/header_values.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ impl HeaderValues {
2929
self.inner.get_mut(index)
3030
}
3131

32+
/// Returns `true` if there is a value corresponding to the specified `HeaderValue` in the list,
33+
/// `false` otherwise.
34+
pub fn contains(&self, value: &HeaderValue) -> bool {
35+
self.inner.contains(value)
36+
}
37+
3238
/// Returns the last `HeaderValue`.
3339
pub fn last(&self) -> &HeaderValue {
3440
self.inner

0 commit comments

Comments
 (0)