Upgrade Zig (#2151)

* fixup

* Upgrade Zig

* Remove bad assertion

* strings

* bump

* mode -> optimize

* optimize

* Linux build

* Update bindgen.zig
This commit is contained in:
Dylan Conway
2023-02-23 23:57:19 -08:00
committed by GitHub
parent b5bdde28ed
commit 3f04f8d0a6
115 changed files with 771 additions and 701 deletions

View File

@@ -63,7 +63,7 @@ pub const MutableString = struct {
pub const ensureUnusedCapacity = growIfNeeded;
pub fn initCopy(allocator: std.mem.Allocator, str: anytype) !MutableString {
var mutable = try MutableString.init(allocator, std.mem.len(str));
var mutable = try MutableString.init(allocator, str.len);
try mutable.copy(str);
return mutable;
}
@@ -145,12 +145,12 @@ pub const MutableString = struct {
}
pub fn copy(self: *MutableString, str: anytype) !void {
try self.list.ensureTotalCapacity(self.allocator, std.mem.len(str[0..]));
try self.list.ensureTotalCapacity(self.allocator, str[0..].len);
if (self.list.items.len == 0) {
try self.list.insertSlice(self.allocator, 0, str);
} else {
try self.list.replaceRange(self.allocator, 0, std.mem.len(str[0..]), str[0..]);
try self.list.replaceRange(self.allocator, 0, str[0..].len, str[0..]);
}
}