mirror of https://github.com/fafhrd91/actix-web
fmt
This commit is contained in:
parent
d6a09f0bed
commit
f86afa1e51
|
@ -27,13 +27,13 @@ macro_rules! method_type {
|
||||||
fn parse(method: &str) -> Result<Self, String> {
|
fn parse(method: &str) -> Result<Self, String> {
|
||||||
match method {
|
match method {
|
||||||
$(stringify!($upper) => Ok(Self::$variant),)+
|
$(stringify!($upper) => Ok(Self::$variant),)+
|
||||||
_ => { if method.chars().all(|c| c.is_ascii_uppercase()) {
|
_ => {
|
||||||
Ok(Self::Custom)
|
if method.chars().all(|c| c.is_ascii_uppercase()) {
|
||||||
} else {
|
Ok(Self::Custom)
|
||||||
Err(format!("HTTP method must be uppercase: `{}`", method))
|
} else {
|
||||||
}
|
Err(format!("HTTP method must be uppercase: `{}`", method))
|
||||||
},
|
}
|
||||||
// _ => Err(format!("Unexpected HTTP method: `{}`", method)),
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue