Skip to content

Commit

Permalink
Merge pull request #464 from CosminPerRam/feat/remove_redundant_guard
Browse files Browse the repository at this point in the history
feat: remove redundant if guard on option value match
  • Loading branch information
Byron authored Feb 18, 2025
2 parents 5c6eaec + 1be8e37 commit ee1571b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/gz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ fn read_to_nul<R: BufRead>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
let mut bytes = r.bytes();
loop {
match bytes.next().transpose()? {
Some(byte) if byte == 0 => {
return Ok(());
}
Some(0) => return Ok(()),
Some(_) if buffer.len() == MAX_HEADER_BUF => {
return Err(Error::new(
ErrorKind::InvalidInput,
Expand Down

0 comments on commit ee1571b

Please # to comment.