Skip to content

Commit abfc164

Browse files
author
Luca Palmieri
committed
Add contains to HeaderValues.
1 parent a169d6b commit abfc164

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)