Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/body/length.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}

Expand Down
7 changes: 3 additions & 4 deletions src/proto/h1/role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,9 @@ impl Http1Transaction for Server {
fn on_error(err: &crate::Error) -> Option<MessageHead<Self::Outgoing>> {
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,
Expand Down
2 changes: 1 addition & 1 deletion src/proto/h2/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
Loading