Skip to content

Commit cdae651

Browse files
authored
Merge pull request #453 from JonathanBrouwer/main
Change private bounds from `R: Read` to `R: BufRead`
2 parents 1567c81 + b7bd31a commit cdae651

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
@@ -115,7 +115,7 @@ impl GzHeaderParser {
115115
}
116116
}
117117

118-
fn parse<'a, R: Read>(&mut self, r: &'a mut R) -> Result<()> {
118+
fn parse<'a, R: BufRead>(&mut self, r: &'a mut R) -> Result<()> {
119119
loop {
120120
match &mut self.state {
121121
GzHeaderState::Start(count, buffer) => {
@@ -248,7 +248,7 @@ fn read_into<R: Read>(r: &mut R, buffer: &mut [u8]) -> Result<usize> {
248248
}
249249

250250
// Read `r` up to the first nul byte, pushing non-nul bytes to `buffer`.
251-
fn read_to_nul<R: Read>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
251+
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()? {

0 commit comments

Comments
 (0)