Skip to content

Commit

Permalink
Fixed clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tact1m4n3 committed Oct 27, 2024
1 parent feae2f7 commit 23c248c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Parser {
}

/// Consumes a byte and returns a raw (not parsed) packet if one is available.
pub fn push_byte_raw<'a>(&'a mut self, byte: u8) -> Option<Result<RawPacket<'a>, ParseError>> {
pub fn push_byte_raw(&mut self, byte: u8) -> Option<Result<RawPacket, ParseError>> {
match self.state {
State::AwaitingSync => {
if self.config.sync.contains(&byte) {
Expand Down Expand Up @@ -152,9 +152,7 @@ impl Parser {
}
}
State::AwaitingLen => {
let Some(byte) = reader.next() else {
return None;
};
let byte = reader.next()?;

if (MIN_LEN_BYTE..=MAX_LEN_BYTE).contains(&byte) {
self.state = State::Reading {
Expand Down Expand Up @@ -229,7 +227,7 @@ impl Iterator for PacketIterator<'_, '_> {
fn next(&mut self) -> Option<Self::Item> {
if let Some((result, remaining_data)) = self.parser.push_bytes(self.remaining_data) {
self.remaining_data = remaining_data;
return Some(result);
Some(result)
} else {
None
}
Expand Down

0 comments on commit 23c248c

Please sign in to comment.