diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-08-30 14:50:33 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-08-31 12:49:18 -0700 |
| commit | 150169f1e0cf08d4b76fed81fc205a63177b6e01 (patch) | |
| tree | c39318b34c361a9a5a8ddaa1aae80cba1fe27f0c /lib/std/Build | |
| parent | ab99dd9c5d22a3d927453081654b1f75b2521b48 (diff) | |
| download | zig-150169f1e0cf08d4b76fed81fc205a63177b6e01.tar.gz zig-150169f1e0cf08d4b76fed81fc205a63177b6e01.zip | |
std.fmt: delete deprecated APIs
std.fmt.Formatter -> std.fmt.Alt
std.fmt.format -> std.Io.Writer.print
Diffstat (limited to 'lib/std/Build')
| -rw-r--r-- | lib/std/Build/Cache/Path.zig | 4 | ||||
| -rw-r--r-- | lib/std/Build/Step/CheckObject.zig | 6 | ||||
| -rw-r--r-- | lib/std/Build/Step/Run.zig | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/Build/Cache/Path.zig b/lib/std/Build/Cache/Path.zig index 335c1dc23e..bf16fc6814 100644 --- a/lib/std/Build/Cache/Path.zig +++ b/lib/std/Build/Cache/Path.zig @@ -147,7 +147,7 @@ pub fn toStringZ(p: Path, allocator: Allocator) Allocator.Error![:0]u8 { return std.fmt.allocPrintSentinel(allocator, "{f}", .{p}, 0); } -pub fn fmtEscapeString(path: Path) std.fmt.Formatter(Path, formatEscapeString) { +pub fn fmtEscapeString(path: Path) std.fmt.Alt(Path, formatEscapeString) { return .{ .data = path }; } @@ -162,7 +162,7 @@ pub fn formatEscapeString(path: Path, writer: *std.Io.Writer) std.Io.Writer.Erro } /// Deprecated, use double quoted escape to print paths. -pub fn fmtEscapeChar(path: Path) std.fmt.Formatter(Path, formatEscapeChar) { +pub fn fmtEscapeChar(path: Path) std.fmt.Alt(Path, formatEscapeChar) { return .{ .data = path }; } diff --git a/lib/std/Build/Step/CheckObject.zig b/lib/std/Build/Step/CheckObject.zig index 4a2efde407..9dfe65829a 100644 --- a/lib/std/Build/Step/CheckObject.zig +++ b/lib/std/Build/Step/CheckObject.zig @@ -595,7 +595,7 @@ fn make(step: *Step, make_options: Step.MakeOptions) !void { // we either format message string with escaped codes, or not to aid debugging // the failed test. const fmtMessageString = struct { - fn fmtMessageString(kind: Check.Kind, msg: []const u8) std.fmt.Formatter(Ctx, formatMessageString) { + fn fmtMessageString(kind: Check.Kind, msg: []const u8) std.fmt.Alt(Ctx, formatMessageString) { return .{ .data = .{ .kind = kind, .msg = msg, @@ -2281,7 +2281,7 @@ const ElfDumper = struct { return mem.sliceTo(@as([*:0]const u8, @ptrCast(strtab.ptr + off)), 0); } - fn fmtShType(sh_type: u32) std.fmt.Formatter(u32, formatShType) { + fn fmtShType(sh_type: u32) std.fmt.Alt(u32, formatShType) { return .{ .data = sh_type }; } @@ -2321,7 +2321,7 @@ const ElfDumper = struct { try writer.writeAll(name); } - fn fmtPhType(ph_type: u32) std.fmt.Formatter(u32, formatPhType) { + fn fmtPhType(ph_type: u32) std.fmt.Alt(u32, formatPhType) { return .{ .data = ph_type }; } diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig index 78cf08dd43..09e75f4c8b 100644 --- a/lib/std/Build/Step/Run.zig +++ b/lib/std/Build/Step/Run.zig @@ -1025,7 +1025,7 @@ fn formatTerm(term: ?std.process.Child.Term, w: *std.Io.Writer) std.Io.Writer.Er try w.writeAll("exited with any code"); } } -fn fmtTerm(term: ?std.process.Child.Term) std.fmt.Formatter(?std.process.Child.Term, formatTerm) { +fn fmtTerm(term: ?std.process.Child.Term) std.fmt.Alt(?std.process.Child.Term, formatTerm) { return .{ .data = term }; } |
