Skip to content

Commit a288266

Browse files
committed
std.Io.Reader: remove aggressive assert from fill
with `.fixed("")` you should still be able to do `fill(1)` and have it return error.EndOfStream.
1 parent a0d1682 commit a288266

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/std/Io/Reader.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,9 +990,9 @@ pub fn discardDelimiterLimit(r: *Reader, delimiter: u8, limit: Limit) DiscardDel
990990
/// Returns `error.EndOfStream` if and only if there are fewer than `n` bytes
991991
/// remaining.
992992
///
993-
/// Asserts buffer capacity is at least `n`.
993+
/// If the end of stream is not encountered, asserts buffer capacity is at
994+
/// least `n`.
994995
pub fn fill(r: *Reader, n: usize) Error!void {
995-
assert(n <= r.buffer.len);
996996
if (r.seek + n <= r.end) {
997997
@branchHint(.likely);
998998
return;

0 commit comments

Comments
 (0)