Skip to content

Commit

Permalink
Update src/codec.rs
Browse files Browse the repository at this point in the history
Co-authored-by: João Antônio Cardoso <[email protected]>
  • Loading branch information
RaulTrombin and joaoantoniocardoso authored Apr 10, 2024
1 parent 014a4db commit f21b622
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ impl Decoder for PingCodec {
let mut consumed = 0;

loop {
let byte = match src.get(consumed) {
Some(b) => *b,
None => return Ok(None),
let Some(byte) = src.get(consumed) else {
return Ok(None);
};

match decoder.parse_byte(byte) {
Expand Down

0 comments on commit f21b622

Please sign in to comment.