Skip to content

Commit

Permalink
Merge pull request #10 from englishm/me/fix-u8-encode
Browse files Browse the repository at this point in the history
moq-transport: Fix u8 encoding
  • Loading branch information
englishm authored Oct 31, 2024
2 parents cfd5566 + d0e5de0 commit 868fde2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions moq-transport/src/coding/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,11 @@ impl Encode for usize {
}

impl Encode for u8 {
/// Encode a varint to the given writer.
/// Encode a u8 to the given writer.
fn encode<W: bytes::BufMut>(&self, w: &mut W) -> Result<(), EncodeError> {
let var = VarInt::from(*self);
var.encode(w)
let x = *self;
w.put_u8(x);
Ok(())
}
}

Expand Down

0 comments on commit 868fde2

Please sign in to comment.