Replace std.mem.copy() with @memcpy()
See: https://github.com/ziglang/zig/pull/18143
This commit is contained in:
parent
9cf8d73bdc
commit
89f18a104d
2
args.zig
2
args.zig
|
@ -475,7 +475,7 @@ fn convertArgumentValue(comptime T: type, allocator: std.mem.Allocator, textInpu
|
||||||
// This is equivalent to allocator.dupeZ but works with any sentinel.
|
// This is equivalent to allocator.dupeZ but works with any sentinel.
|
||||||
if (comptime std.meta.sentinel(T)) |sentinel| {
|
if (comptime std.meta.sentinel(T)) |sentinel| {
|
||||||
const data = try allocator.alloc(u8, textInput.len + 1);
|
const data = try allocator.alloc(u8, textInput.len + 1);
|
||||||
std.mem.copy(u8, data, textInput);
|
@memcpy(data[0..textInput.len], textInput);
|
||||||
data[textInput.len] = sentinel;
|
data[textInput.len] = sentinel;
|
||||||
|
|
||||||
return data[0..textInput.len :sentinel];
|
return data[0..textInput.len :sentinel];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user