Skip to content

Commit 95be339

Browse files
authored
Making clippy happy (image-rs#2439)
1 parent c62d3ac commit 95be339

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/codecs/pnm/decoder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ trait HeaderReader: Read {
370370
let mut bytes = Vec::new();
371371

372372
// pair input bytes with a bool mask to remove comments
373+
#[allow(clippy::unbuffered_bytes)]
373374
let mark_comments = self.bytes().scan(true, |partof, read| {
374375
let byte = match read {
375376
Err(err) => return Some((*partof, Err(err))),
@@ -489,6 +490,7 @@ trait HeaderReader: Read {
489490
}
490491
}
491492

493+
#[allow(clippy::unbuffered_bytes)]
492494
match self.bytes().next() {
493495
None => return Err(ImageError::IoError(io::ErrorKind::UnexpectedEof.into())),
494496
Some(Err(io)) => return Err(ImageError::IoError(io)),
@@ -688,6 +690,7 @@ fn read_separated_ascii<T: TryFrom<u16>>(reader: &mut dyn Read) -> ImageResult<T
688690
let is_separator = |v: &u8| matches!(*v, b'\t' | b'\n' | b'\x0b' | b'\x0c' | b'\r' | b' ');
689691

690692
let mut v: u16 = 0;
693+
#[allow(clippy::unbuffered_bytes)]
691694
for rc in reader
692695
.bytes()
693696
.skip_while(|v| v.as_ref().ok().is_some_and(is_separator))
@@ -763,6 +766,7 @@ impl Sample for PbmBit {
763766
}
764767

765768
fn from_ascii(reader: &mut dyn Read, output_buf: &mut [u8]) -> ImageResult<()> {
769+
#[allow(clippy::unbuffered_bytes)]
766770
let mut bytes = reader.bytes();
767771
for b in output_buf {
768772
loop {

0 commit comments

Comments
 (0)