Closed
Description
pub fn get_as_str<T: Into<HeaderName>>(&self, key: T) -> Option<&str> {
self.get(key).map(|v| v.as_str())
}
I think we should just get rid of the variants of this methods and only have the variants which return a
crate::Result
. If you need an option, you can just call.ok()
on theResult
.
And of course, then we just use the simpler naming convention and not theor_err
names.
#833 (review)
pub fn get_as_enum<T: Into<HeaderName>, V: FromStr<Err = E>, E>(
This is a bit more general than for enums. Can we call this
get_as_parsed
or something like that? I thinkget_as_u64_or_err
can be implemented using this function.
Metadata
Metadata
Assignees
Labels
No labels