aboutsummaryrefslogtreecommitdiff
path: root/lib/std/cstr.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-06-24 16:58:19 -0700
committerGitHub <noreply@github.com>2023-06-24 16:58:19 -0700
commit146b79af153bbd5dafda0ba12a040385c7fc58f8 (patch)
tree67e3db8b444d65c667e314770fc983a7fc8ba293 /lib/std/cstr.zig
parent13853bef0df3c90633021850cc6d6abaeea03282 (diff)
parent21ac0beb436f49fe49c6982a872f2dc48e4bea5e (diff)
downloadzig-146b79af153bbd5dafda0ba12a040385c7fc58f8.tar.gz
zig-146b79af153bbd5dafda0ba12a040385c7fc58f8.zip
Merge pull request #16163 from mlugg/feat/builtins-infer-dest-ty
Infer destination type of cast builtins using result type
Diffstat (limited to 'lib/std/cstr.zig')
-rw-r--r--lib/std/cstr.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/cstr.zig b/lib/std/cstr.zig
index 9bd98a72b7..0888edf10d 100644
--- a/lib/std/cstr.zig
+++ b/lib/std/cstr.zig
@@ -89,12 +89,12 @@ pub const NullTerminated2DArray = struct {
return NullTerminated2DArray{
.allocator = allocator,
.byte_count = byte_count,
- .ptr = @ptrCast(?[*:null]?[*:0]u8, buf.ptr),
+ .ptr = @as(?[*:null]?[*:0]u8, @ptrCast(buf.ptr)),
};
}
pub fn deinit(self: *NullTerminated2DArray) void {
- const buf = @ptrCast([*]u8, self.ptr);
+ const buf = @as([*]u8, @ptrCast(self.ptr));
self.allocator.free(buf[0..self.byte_count]);
}
};