From b7bd31ad974a2e5d10c8409282a09b2ea4e8a2e6 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Wed, 12 Feb 2025 16:42:30 +0100 Subject: [PATCH] Change internal bounds from `R: Read` to `R: BufRead` --- src/gz/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gz/mod.rs b/src/gz/mod.rs index 157c517c..5b0e986d 100644 --- a/src/gz/mod.rs +++ b/src/gz/mod.rs @@ -120,7 +120,7 @@ impl GzHeaderParser { } } - fn parse<'a, R: Read>(&mut self, r: &'a mut R) -> Result<()> { + fn parse<'a, R: BufRead>(&mut self, r: &'a mut R) -> Result<()> { loop { match &mut self.state { GzHeaderState::Start(count, buffer) => { @@ -253,7 +253,7 @@ fn read_into(r: &mut R, buffer: &mut [u8]) -> Result { } // Read `r` up to the first nul byte, pushing non-nul bytes to `buffer`. -fn read_to_nul(r: &mut R, buffer: &mut Vec) -> Result<()> { +fn read_to_nul(r: &mut R, buffer: &mut Vec) -> Result<()> { let mut bytes = r.bytes(); loop { match bytes.next().transpose()? {