mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
[std] fix compile error in std.Io.Writer.failing
This commit is contained in:
parent
99c4890559
commit
4fcdb08390
@ -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];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user