diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-11 09:21:06 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-11 09:21:06 -0500 |
| commit | fd6a36a23509fb956e05f0052b8ab5a80ead3380 (patch) | |
| tree | 3d4467eae7a82b33d7684255e63b6df8cea3dd51 /std | |
| parent | 9a51091a5c3d7547989d705e3feebad6252019a6 (diff) | |
| download | zig-fd6a36a23509fb956e05f0052b8ab5a80ead3380.tar.gz zig-fd6a36a23509fb956e05f0052b8ab5a80ead3380.zip | |
self-hosted: parsing and rendering blocks
Diffstat (limited to 'std')
| -rw-r--r-- | std/io.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/std/io.zig b/std/io.zig index b677e457f7..0ba3d06a01 100644 --- a/std/io.zig +++ b/std/io.zig @@ -481,6 +481,14 @@ pub const OutStream = struct { const slice = (&byte)[0..1]; return self.writeFn(self, slice); } + + pub fn writeByteNTimes(self: &OutStream, byte: u8, n: usize) -> %void { + const slice = (&byte)[0..1]; + var i: usize = 0; + while (i < n) : (i += 1) { + %return self.writeFn(self, slice); + } + } }; /// `path` may need to be copied in memory to add a null terminating byte. In this case |
