mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
[std] fix compile error in std.Io.Writer.failing
This commit is contained in:
parent
99c4890559
commit
4fcdb08390
1 changed files with 6 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue