Skip to content

Commit

Permalink
chore: fix up some clippy nags (#709)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar authored Aug 21, 2023
1 parent cdcc641 commit da9f34b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
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
}
}

0 comments on commit da9f34b

Please sign in to comment.