authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-18 16:48:26-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-02-18 16:48:26-05:00
loga8d7652001525881fe17ddf42f5f86671d706b4b
tree08b33e396c8fc816ea9c7d41348514d0342d82e3
parent3632f31ec2991005f2269eac955cd5ef589fe5ed
signature Commit is signed but in an unrecognized format.

avoid a `@ptrCast` with an array literal


1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/io.zig+1-1
...@@ -239,7 +239,7 @@ pub fn PeekStream(comptime buffer_type: std.fifo.LinearFifoBufferType, comptime...@@ -239,7 +239,7 @@ pub fn PeekStream(comptime buffer_type: std.fifo.LinearFifoBufferType, comptime
239 };239 };
240240
241 pub fn putBackByte(self: *Self, byte: u8) !void {241 pub fn putBackByte(self: *Self, byte: u8) !void {
242 try self.putBack(@ptrCast([*]const u8, &byte)[0..1]);242 try self.putBack(&[_]u8{byte});
243 }243 }
244244
245 pub fn putBack(self: *Self, bytes: []const u8) !void {245 pub fn putBack(self: *Self, bytes: []const u8) !void {