mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Merge branch 'trunk' into update_zig_09
This commit is contained in:
commit
9491d5fae9
83 changed files with 4010 additions and 797 deletions
|
@ -468,8 +468,10 @@ fn strFromIntHelp(comptime T: type, int: T) RocStr {
|
|||
const size = comptime blk: {
|
||||
// the string representation of the minimum i128 value uses at most 40 characters
|
||||
var buf: [40]u8 = undefined;
|
||||
var result = std.fmt.bufPrint(&buf, "{}", .{std.math.minInt(T)}) catch unreachable;
|
||||
break :blk result.len;
|
||||
var resultMin = std.fmt.bufPrint(&buf, "{}", .{std.math.minInt(T)}) catch unreachable;
|
||||
var resultMax = std.fmt.bufPrint(&buf, "{}", .{std.math.maxInt(T)}) catch unreachable;
|
||||
var result = if (resultMin.len > resultMax.len) resultMin.len else resultMax.len;
|
||||
break :blk result;
|
||||
};
|
||||
|
||||
var buf: [size]u8 = undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue