Function splatByteAll [src]
Writes the same byte many times, performing the underlying write call as
many times as necessary.
Prototype
pub fn splatByteAll(w: *Writer, byte: u8, n: usize) Error!void Parameters
w: *Writerbyte: u8n: usize Possible Errors
See the Writer implementation for detailed diagnostics.
Example
test splatByteAll {
var aw: Writer.Allocating = .init(testing.allocator);
defer aw.deinit();
try aw.writer.splatByteAll('7', 45);
try testing.expectEqualStrings("7" ** 45, aw.writer.buffered());
} Source
pub fn splatByteAll(w: *Writer, byte: u8, n: usize) Error!void {
var remaining: usize = n;
while (remaining > 0) remaining -= try w.splatByte(byte, remaining);
}