diff options
| author | Benjamin Feng <benjamin.feng@glassdoor.com> | 2020-03-06 16:59:21 -0600 |
|---|---|---|
| committer | Benjamin Feng <benjamin.feng@glassdoor.com> | 2020-03-12 10:41:09 -0500 |
| commit | 4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30 (patch) | |
| tree | a4116c5259e3f39df939008f23ac66f65ce61194 /lib/std/builtin.zig | |
| parent | ed7f30e1cd0c00c82c511ad826fe8d8b60b2f57f (diff) | |
| download | zig-4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30.tar.gz zig-4aae55b4ccf44fa3c2c2a81a6a34f3c898dece30.zip | |
Replace fmt with new fmtstream
Diffstat (limited to 'lib/std/builtin.zig')
| -rw-r--r-- | lib/std/builtin.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig index 5cac8c9622..c8cd6c05cf 100644 --- a/lib/std/builtin.zig +++ b/lib/std/builtin.zig @@ -426,27 +426,27 @@ pub const Version = struct { pub fn parse(text: []const u8) !Version { var it = std.mem.separate(text, "."); return Version{ - .major = try std.fmtstream.parseInt(u32, it.next() orelse return error.InvalidVersion, 10), - .minor = try std.fmtstream.parseInt(u32, it.next() orelse "0", 10), - .patch = try std.fmtstream.parseInt(u32, it.next() orelse "0", 10), + .major = try std.fmt.parseInt(u32, it.next() orelse return error.InvalidVersion, 10), + .minor = try std.fmt.parseInt(u32, it.next() orelse "0", 10), + .patch = try std.fmt.parseInt(u32, it.next() orelse "0", 10), }; } pub fn format( self: Version, comptime fmt: []const u8, - options: std.fmtstream.FormatOptions, + options: std.fmt.FormatOptions, out_stream: var, ) !void { if (fmt.len == 0) { if (self.patch == 0) { if (self.minor == 0) { - return std.fmtstream.format(out_stream, "{}", .{self.major}); + return std.fmt.format(out_stream, "{}", .{self.major}); } else { - return std.fmtstream.format(out_stream, "{}.{}", .{ self.major, self.minor }); + return std.fmt.format(out_stream, "{}.{}", .{ self.major, self.minor }); } } else { - return std.fmtstream.format(out_stream, "{}.{}.{}", .{ self.major, self.minor, self.patch }); + return std.fmt.format(out_stream, "{}.{}.{}", .{ self.major, self.minor, self.patch }); } } else { @compileError("Unknown format string: '" ++ fmt ++ "'"); |
