diff --git a/Cargo.toml b/Cargo.toml index 7f372a27ed..ed5e00c770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,7 +127,6 @@ needless_pass_by_value = "allow" pattern_type_mismatch = "allow" redundant_else = "allow" struct_excessive_bools = "allow" # TODO: bogus lint? -unnested_or_patterns = "allow" unused_async = "allow" # TODO: is it for API? unused_trait_names = "allow" # TODO: kinda annoying, but might be good to deny unwrap_in_result = "allow" diff --git a/src/body/length.rs b/src/body/length.rs index ba121bde11..385a8b3c3b 100644 --- a/src/body/length.rs +++ b/src/body/length.rs @@ -68,7 +68,7 @@ impl DecodedLength { ))] pub(crate) fn sub_if(&mut self, amt: u64) { match self { - &mut DecodedLength::CHUNKED | &mut DecodedLength::CLOSE_DELIMITED => (), + &mut (DecodedLength::CHUNKED | DecodedLength::CLOSE_DELIMITED) => (), DecodedLength(known) => { *known -= amt; } diff --git a/src/error.rs b/src/error.rs index bfbcf90cc5..48609ffcb3 100644 --- a/src/error.rs +++ b/src/error.rs @@ -193,7 +193,7 @@ impl Error { pub fn is_parse_too_large(&self) -> bool { matches!( self.inner.kind, - Kind::Parse(Parse::TooLarge) | Kind::Parse(Parse::UriTooLong) + Kind::Parse(Parse::TooLarge | Parse::UriTooLong) ) } diff --git a/src/proto/h1/role.rs b/src/proto/h1/role.rs index fce1df78af..e976931c76 100644 --- a/src/proto/h1/role.rs +++ b/src/proto/h1/role.rs @@ -493,10 +493,9 @@ impl Http1Transaction for Server { fn on_error(err: &crate::Error) -> Option> { use crate::error::Kind; let status = match *err.kind() { - Kind::Parse(Parse::Method) - | Kind::Parse(Parse::Header(_)) - | Kind::Parse(Parse::Uri) - | Kind::Parse(Parse::Version) => StatusCode::BAD_REQUEST, + Kind::Parse(Parse::Method | Parse::Header(_) | Parse::Uri | Parse::Version) => { + StatusCode::BAD_REQUEST + } Kind::Parse(Parse::TooLarge) => StatusCode::REQUEST_HEADER_FIELDS_TOO_LARGE, Kind::Parse(Parse::UriTooLong) => StatusCode::URI_TOO_LONG, _ => return None, diff --git a/src/proto/h2/upgrade.rs b/src/proto/h2/upgrade.rs index def1fcfc96..50addbc998 100644 --- a/src/proto/h2/upgrade.rs +++ b/src/proto/h2/upgrade.rs @@ -179,7 +179,7 @@ impl Read for H2Upgraded { } Some(Err(e)) => { return Poll::Ready(match e.reason() { - Some(Reason::NO_ERROR) | Some(Reason::CANCEL) => Ok(()), + Some(Reason::NO_ERROR | Reason::CANCEL) => Ok(()), Some(Reason::STREAM_CLOSED) => { Err(std::io::Error::new(std::io::ErrorKind::BrokenPipe, e)) }