Fix assumptions about header value types
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
40bf9965ac
commit
767b7c72f7
@ -60,8 +60,9 @@ impl Response {
|
||||
#( #cfg_attrs )*
|
||||
#field_name: {
|
||||
headers.remove(#header_name)
|
||||
.map(|h| h.to_str().map(|s| s.to_owned()))
|
||||
.map(|h| h.to_str().map(str::to_owned))
|
||||
.transpose()?
|
||||
.map(Into::into)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,7 +72,7 @@ impl Response {
|
||||
headers.remove(#header_name)
|
||||
.expect("response missing expected header")
|
||||
.to_str()?
|
||||
.to_owned()
|
||||
.into()
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user