Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix up some clippy nags #709

Merged
merged 1 commit into from
Aug 21, 2023
Merged
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
6 changes: 3 additions & 3 deletions src/hpack/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ fn decode_int<B: Buf>(buf: &mut B, prefix_size: u8) -> Result<usize, DecoderErro
Err(DecoderError::NeedMore(NeedMore::IntegerUnderflow))
}

fn peek_u8<B: Buf>(buf: &mut B) -> Option<u8> {
fn peek_u8<B: Buf>(buf: &B) -> Option<u8> {
if buf.has_remaining() {
Some(buf.chunk()[0])
} else {
Expand Down Expand Up @@ -835,9 +835,9 @@ mod test {
fn test_peek_u8() {
let b = 0xff;
let mut buf = Cursor::new(vec![b]);
assert_eq!(peek_u8(&mut buf), Some(b));
assert_eq!(peek_u8(&buf), Some(b));
assert_eq!(buf.get_u8(), b);
assert_eq!(peek_u8(&mut buf), None);
assert_eq!(peek_u8(&buf), None);
}

#[test]
Expand Down
9 changes: 2 additions & 7 deletions src/proto/streams/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ enum Inner {
Closed(Cause),
}

#[derive(Debug, Copy, Clone)]
#[derive(Debug, Copy, Clone, Default)]
enum Peer {
#[default]
AwaitingHeaders,
Streaming,
}
Expand Down Expand Up @@ -466,9 +467,3 @@ impl Default for State {
State { inner: Inner::Idle }
}
}

impl Default for Peer {
fn default() -> Self {
AwaitingHeaders
}
}