Commit a8d7652001

Andrew Kelley <andrew@ziglang.org>
2020-02-18 22:48:26
avoid a `@ptrCast` with an array literal
1 parent 3632f31
Changed files (1)
lib
std
lib/std/io.zig
@@ -239,7 +239,7 @@ pub fn PeekStream(comptime buffer_type: std.fifo.LinearFifoBufferType, comptime
         };
 
         pub fn putBackByte(self: *Self, byte: u8) !void {
-            try self.putBack(@ptrCast([*]const u8, &byte)[0..1]);
+            try self.putBack(&[_]u8{byte});
         }
 
         pub fn putBack(self: *Self, bytes: []const u8) !void {