Skip to content

Commit b7bd31a

Browse files
Change internal bounds from R: Read to R: BufRead
1 parent 2d68455 commit b7bd31a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gz/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl GzHeaderParser {
120120
}
121121
}
122122

123-
fn parse<'a, R: Read>(&mut self, r: &'a mut R) -> Result<()> {
123+
fn parse<'a, R: BufRead>(&mut self, r: &'a mut R) -> Result<()> {
124124
loop {
125125
match &mut self.state {
126126
GzHeaderState::Start(count, buffer) => {
@@ -253,7 +253,7 @@ fn read_into<R: Read>(r: &mut R, buffer: &mut [u8]) -> Result<usize> {
253253
}
254254

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

0 commit comments

Comments
 (0)