mirror of
https://github.com/ziglang/zig.git
synced 2026-01-29 02:35:28 +00:00
Fix big.Int toString maybe-null allocator
This commit is contained in:
parent
5f4fcd5030
commit
b3ecdfd7bf
@ -449,9 +449,11 @@ pub const Int = struct {
|
||||
comptime FmtError: type,
|
||||
output: fn (@typeOf(context), []const u8) FmtError!void,
|
||||
) FmtError!void {
|
||||
self.assertWritable();
|
||||
// TODO look at fmt and support other bases
|
||||
const str = self.toString(self.allocator, 10) catch @panic("TODO make this non allocating");
|
||||
defer self.allocator.free(str);
|
||||
// TODO support read-only fixed integers
|
||||
const str = self.toString(self.allocator.?, 10) catch @panic("TODO make this non allocating");
|
||||
defer self.allocator.?.free(str);
|
||||
return output(context, str);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user