Skip to content

Commit

Permalink
Fix issue with new buffered reader from the std lib, all tests passed…
Browse files Browse the repository at this point in the history
… now
  • Loading branch information
mlarouche committed Oct 17, 2024
1 parent 8dc8194 commit 0235718
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/buffered_stream_source.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ pub fn BufferedStreamSourceReader(comptime BufferSize: usize) type {
return switch (self.buffered_reader.unbuffered_reader.context.*) {
.buffer => |*actual_reader| actual_reader.read(dest),
.const_buffer => |*actual_reader| actual_reader.read(dest),
.file => self.buffered_reader.read(dest),
.file => {
var index: usize = 0;
while (index < dest.len) {
const amt = try self.buffered_reader.read(dest[index..]);
if (amt == 0) break;
index += amt;
}
return index;
},
};
}

Expand Down

0 comments on commit 0235718

Please sign in to comment.