We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
R: Read
R: BufRead
1 parent 2d68455 commit b7bd31aCopy full SHA for b7bd31a
src/gz/mod.rs
@@ -120,7 +120,7 @@ impl GzHeaderParser {
120
}
121
122
123
- fn parse<'a, R: Read>(&mut self, r: &'a mut R) -> Result<()> {
+ fn parse<'a, R: BufRead>(&mut self, r: &'a mut R) -> Result<()> {
124
loop {
125
match &mut self.state {
126
GzHeaderState::Start(count, buffer) => {
@@ -253,7 +253,7 @@ fn read_into<R: Read>(r: &mut R, buffer: &mut [u8]) -> Result<usize> {
253
254
255
// 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<()> {
+fn read_to_nul<R: BufRead>(r: &mut R, buffer: &mut Vec<u8>) -> Result<()> {
257
let mut bytes = r.bytes();
258
259
match bytes.next().transpose()? {
0 commit comments