aboutsummaryrefslogtreecommitdiff
path: root/lib/std/SemanticVersion.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-05 10:43:14 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-07-07 22:43:53 -0700
commit5378fdb153bc76990105e3640e7725e434e8cdee (patch)
tree9791e08538c10c521f5634ed79e3b369fcd004df /lib/std/SemanticVersion.zig
parent4ccc6f2b5777afd06f0fddbea4e0e0d0c92b007d (diff)
downloadzig-5378fdb153bc76990105e3640e7725e434e8cdee.tar.gz
zig-5378fdb153bc76990105e3640e7725e434e8cdee.zip
std.fmt: fully remove format string from format methods
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
Diffstat (limited to 'lib/std/SemanticVersion.zig')
-rw-r--r--lib/std/SemanticVersion.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/std/SemanticVersion.zig b/lib/std/SemanticVersion.zig
index 50b146d74f..52b5908693 100644
--- a/lib/std/SemanticVersion.zig
+++ b/lib/std/SemanticVersion.zig
@@ -150,8 +150,7 @@ fn parseNum(text: []const u8) error{ InvalidVersion, Overflow }!usize {
};
}
-pub fn format(self: Version, w: *std.io.Writer, comptime fmt: []const u8) std.io.Writer.Error!void {
- if (fmt.len != 0) std.fmt.invalidFmtError(fmt, self);
+pub fn format(self: Version, w: *std.io.Writer) std.io.Writer.Error!void {
try w.print("{d}.{d}.{d}", .{ self.major, self.minor, self.patch });
if (self.pre) |pre| try w.print("-{s}", .{pre});
if (self.build) |build| try w.print("+{s}", .{build});