[std] fix compile error in std.Io.Writer.failing

This commit is contained in:
Josh Wolfe 2025-08-15 17:04:39 -04:00 committed by Andrew Kelley
parent 99c4890559
commit 4fcdb08390

View File

@ -141,8 +141,14 @@ pub const failing: Writer = .{
.sendFile = failingSendFile,
.rebase = failingRebase,
},
.buffer = &.{},
};
test failing {
var fw: Writer = .failing;
try testing.expectError(error.WriteFailed, fw.writeAll("always fails"));
}
/// Returns the contents not yet drained.
pub fn buffered(w: *const Writer) []u8 {
return w.buffer[0..w.end];