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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ unwrap_in_result = "allow"
wildcard_enum_match_arm = "allow"
definition_in_module_root = "allow"
unnecessary_rest_pattern = "allow"
rest_pattern_accessible_field = "allow"
needless_bool = "allow"

# explicitly allowed
Expand Down Expand Up @@ -191,6 +190,7 @@ too_many_lines = "allow" # reconsider someday?
type_complexity = "allow" # not helpful
used_underscore_items = "allow"
unnecessary_safety_comment = "allow" # more safety comments are a good thing
unneeded_field_pattern = "allow" # exhaustive matching is helpful
unseparated_literal_suffix = "allow" # i don't like 0_u8 (do i?)

[package.metadata.docs.rs]
Expand Down
24 changes: 20 additions & 4 deletions src/body/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,17 @@ impl Body for Incoming {
match &self.kind {
Kind::Empty => true,
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
Kind::Chan { content_length, .. } => *content_length == DecodedLength::ZERO,
Kind::Chan {
content_length,
rx: _,
} => *content_length == DecodedLength::ZERO,
#[cfg(all(feature = "http2", any(feature = "client", feature = "server")))]
Kind::H2 { recv: h2, .. } => h2.is_end_stream(),
Kind::H2 {
recv: h2,
content_length: _,
data_done: _,
ping: _,
} => h2.is_end_stream(),
#[cfg(feature = "ffi")]
Kind::Ffi(..) => false,
}
Expand All @@ -259,9 +267,17 @@ impl Body for Incoming {
match self.kind {
Kind::Empty => SizeHint::with_exact(0),
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
Kind::Chan { content_length, .. } => opt_len(content_length),
Kind::Chan {
content_length,
rx: _,
} => opt_len(content_length),
#[cfg(all(feature = "http2", any(feature = "client", feature = "server")))]
Kind::H2 { content_length, .. } => opt_len(content_length),
Kind::H2 {
content_length,
data_done: _,
ping: _,
recv: _,
} => opt_len(content_length),
#[cfg(feature = "ffi")]
Kind::Ffi(..) => SizeHint::default(),
}
Expand Down
7 changes: 6 additions & 1 deletion src/proto/h1/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ impl Decoder {
Length(0)
| Chunked {
state: ChunkedState::End,
..
chunk_len: _,
extensions_cnt: _,
trailers_buf: _,
trailers_cnt: _,
h1_max_headers: _,
h1_max_header_size: _,
}
| Eof(true)
)
Expand Down
2 changes: 2 additions & 0 deletions src/proto/h1/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ impl ReadStrategy {
}
}

#[allow(clippy::rest_pattern_accessible_field/*reason: this is an accessor*/)]
fn next(&self) -> usize {
match *self {
ReadStrategy::Adaptive { next, .. } => next,
Expand All @@ -397,6 +398,7 @@ impl ReadStrategy {
}
}

#[allow(clippy::rest_pattern_accessible_field/*reason: this is an accessor*/)]
fn max(&self) -> usize {
match *self {
ReadStrategy::Adaptive { max, .. } => max,
Expand Down
5 changes: 4 additions & 1 deletion src/proto/h2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ where
pub(crate) fn graceful_shutdown(&mut self) {
trace!("graceful_shutdown");
match &mut self.state {
State::Handshaking { .. } => {
State::Handshaking {
ping_config: _,
hs: _,
} => {
self.close_pending = true;
}
State::Serving(srv) => {
Expand Down
Loading