We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std.mem.copy
std.mem.copyForwards
A recent PR for the Zig standard library removes the std.mem.copy function, which was an alias for std.mem.copyForwards. This function was used in toOwned().
toOwned()
A proposed fix:
pub fn toOwned(self: String) Error!?[]u8 { if (self.buffer != null) { const string = self.str(); if (self.allocator.alloc(u8, string.len)) |newStr| { std.mem.copyForwards(u8, newStr, string); // replace std.mem.copy with std.mem.copyForwards return newStr; } else |_| { return Error.OutOfMemory; } } return null; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A recent PR for the Zig standard library removes the
std.mem.copy
function, which was an alias forstd.mem.copyForwards
. This function was used intoOwned()
.A proposed fix:
The text was updated successfully, but these errors were encountered: