Skip to content

Commit

Permalink
Merge pull request #453 from JonathanBrouwer/main
Browse files Browse the repository at this point in the history
Change private bounds from `R: Read` to `R: BufRead`
  • Loading branch information
Byron authored Feb 13, 2025
2 parents 1567c81 + b7bd31a commit cdae651
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,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) => {
Expand Down Expand Up @@ -248,7 +248,7 @@ fn read_into<R: Read>(r: &mut R, buffer: &mut [u8]) -> Result<usize> {
}

// Read `r` up to the first nul byte, pushing non-nul bytes to `buffer`.
fn read_to_nul<R: Read>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
fn read_to_nul<R: BufRead>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
let mut bytes = r.bytes();
loop {
match bytes.next().transpose()? {
Expand Down

0 comments on commit cdae651

Please # to comment.