File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use bytes::{Bytes, BytesMut};
3
3
use std:: convert:: TryFrom ;
4
4
use std:: error:: Error ;
5
5
use std:: fmt:: Write ;
6
+ use std:: hash:: { Hash , Hasher } ;
6
7
use std:: str:: FromStr ;
7
8
use std:: { cmp, fmt, mem, str} ;
8
9
@@ -17,7 +18,7 @@ use crate::header::name::HeaderName;
17
18
/// To handle this, the `HeaderValue` is useable as a type and can be compared
18
19
/// with strings and implements `Debug`. A `to_str` fn is provided that returns
19
20
/// an `Err` if the header value contains non visible ascii characters.
20
- #[ derive( Clone , Hash ) ]
21
+ #[ derive( Clone ) ]
21
22
pub struct HeaderValue {
22
23
inner : Bytes ,
23
24
is_sensitive : bool ,
@@ -617,6 +618,12 @@ impl Error for ToStrError {}
617
618
618
619
// ===== PartialEq / PartialOrd =====
619
620
621
+ impl Hash for HeaderValue {
622
+ fn hash < H : Hasher > ( & self , state : & mut H ) {
623
+ self . inner . hash ( state) ;
624
+ }
625
+ }
626
+
620
627
impl PartialEq for HeaderValue {
621
628
#[ inline]
622
629
fn eq ( & self , other : & HeaderValue ) -> bool {
You can’t perform that action at this time.
0 commit comments