Skip to content

Commit 56b6c99

Browse files
committed
update for zig 0.14
1 parent 9d566c1 commit 56b6c99

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

build.zig.zon

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.{
2-
.name = "fmtHelper",
3-
.version = "0.0.1",
4-
.minimum_zig_version = "0.12.0",
2+
.name = "fmt_helper",
3+
.version = "0.0.2",
4+
.minimum_zig_version = "0.14.0-dev.3217+5b9b5e45c",
55
.paths = .{
66
"build.zig",
77
"build.zig.zon",

fmt.zig

+6-6
Original file line numberDiff line numberDiff line change
@@ -381,24 +381,24 @@ fn Format_SI_Int(comptime T: type, comptime si_options: Format_SI_Int_Options) t
381381

382382
fn Format_SI_Formatter(comptime T: type, comptime unit: []const u8) type {
383383
return switch (@typeInfo(T)) {
384-
.Float, .ComptimeFloat => std.fmt.Formatter(format_si_float),
385-
.Int => Format_SI_Int(T, .{ .unit = unit }).Formatter,
386-
.ComptimeInt => Format_SI_Int(i64, .{ .unit = unit }).Formatter,
384+
.float, .comptime_float => std.fmt.Formatter(format_si_float),
385+
.int => Format_SI_Int(T, .{ .unit = unit }).Formatter,
386+
.comptime_int => Format_SI_Int(i64, .{ .unit = unit }).Formatter,
387387
else => @compileError("Expected float or int value"),
388388
};
389389
}
390390

391391
pub fn fmtSI(value: anytype, comptime unit: []const u8) Format_SI_Formatter(@TypeOf(value), unit) {
392392
switch (@typeInfo(@TypeOf(value))) {
393-
.Float, .ComptimeFloat => {
393+
.float, .comptime_float => {
394394
const data = Format_SI_Float_Data{ .value = value, .unit = unit };
395395
return .{ .data = data };
396396
},
397-
.Int => {
397+
.int => {
398398
const data = Format_SI_Int(@TypeOf(value), .{ .unit = unit }) { .value = value };
399399
return .{ .data = data };
400400
},
401-
.ComptimeInt => {
401+
.comptime_int => {
402402
const data = Format_SI_Int(i64, .{ .unit = unit }) { .value = @intCast(value) };
403403
return .{ .data = data };
404404
},

license

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2024 Benjamin M. Crist
1+
Copyright 2024-2025 Benjamin M. Crist
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

0 commit comments

Comments
 (0)