refactor(headers): errors for parse_header
Header::parse_header() returns now a hyper Result instead of an option this will enable more precise Error messages in the future, currently most failures are reported as ::Error::Header. BREAKING CHANGE: parse_header returns Result instead of Option, related code did also change
This commit is contained in:
@@ -52,8 +52,8 @@ pub enum RangeUnit {
|
||||
|
||||
|
||||
impl FromStr for RangeUnit {
|
||||
type Err = ();
|
||||
fn from_str(s: &str) -> Result<Self, ()> {
|
||||
type Err = ::Error;
|
||||
fn from_str(s: &str) -> ::Result<Self> {
|
||||
match s {
|
||||
"bytes" => Ok(RangeUnit::Bytes),
|
||||
"none" => Ok(RangeUnit::None),
|
||||
|
||||
Reference in New Issue
Block a user