aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-06-04 22:11:14 -0400
committerGitHub <noreply@github.com>2018-06-04 22:11:14 -0400
commite53b683bd3958a7b1c517e2391edce42b9d4e48b (patch)
treec9b8aacf92b2140c1cc076e2de280e10657d0a98 /std/io.zig
parent32e0dfd4f0dab351a024e7680280343db5d7c43e (diff)
downloadzig-e53b683bd3958a7b1c517e2391edce42b9d4e48b.tar.gz
zig-e53b683bd3958a7b1c517e2391edce42b9d4e48b.zip
Pointer Reform: proper slicing and indexing (#1053)
* enable slicing for single-item ptr to arrays * disable slicing for other single-item pointers * enable indexing for single-item ptr to arrays * disable indexing for other single-item pointers see #770 closes #386
Diffstat (limited to 'std/io.zig')
-rw-r--r--std/io.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/io.zig b/std/io.zig
index e20a284e4e..a603d0cf5e 100644
--- a/std/io.zig
+++ b/std/io.zig
@@ -219,12 +219,12 @@ pub fn OutStream(comptime WriteError: type) type {
}
pub fn writeByte(self: *Self, byte: u8) !void {
- const slice = (&byte)[0..1];
+ const slice = (*[1]u8)(&byte)[0..];
return self.writeFn(self, slice);
}
pub fn writeByteNTimes(self: *Self, byte: u8, n: usize) !void {
- const slice = (&byte)[0..1];
+ const slice = (*[1]u8)(&byte)[0..];
var i: usize = 0;
while (i < n) : (i += 1) {
try self.writeFn(self, slice);