Skip to content

Commit ee1571b

Browse files
authored
Merge pull request #464 from CosminPerRam/feat/remove_redundant_guard
feat: remove redundant if guard on option value match
2 parents 5c6eaec + 1be8e37 commit ee1571b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/gz/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,7 @@ fn read_to_nul<R: BufRead>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
252252
let mut bytes = r.bytes();
253253
loop {
254254
match bytes.next().transpose()? {
255-
Some(byte) if byte == 0 => {
256-
return Ok(());
257-
}
255+
Some(0) => return Ok(()),
258256
Some(_) if buffer.len() == MAX_HEADER_BUF => {
259257
return Err(Error::new(
260258
ErrorKind::InvalidInput,

0 commit comments

Comments
 (0)