From e3f17b5ca51de6f0aaa3edaf44fff27869183de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oto=20=C5=A0=C5=A5=C3=A1va?= Date: Fri, 12 Sep 2025 19:24:35 +0200 Subject: [PATCH] std.Io.Writer.print: Clarify and fix docs for {f} Fixes the incorrect signature for the `format` method - it originally copied the one of `std.io.Writer.print`, which is not what is accepted. Additionally, I added a reference to `std.fmt.Alt` for overriding. --- lib/std/Io/Writer.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/Io/Writer.zig b/lib/std/Io/Writer.zig index 7f1b1fd884..4d58ab9455 100644 --- a/lib/std/Io/Writer.zig +++ b/lib/std/Io/Writer.zig @@ -586,7 +586,8 @@ pub fn writeAll(w: *Writer, bytes: []const u8) Error!void { /// - `!`: output error union value as either the unwrapped value, or the formatted error value; may be followed by a format specifier for the underlying value. /// - `*`: output the address of the value instead of the value itself. /// - `any`: output a value of any type using its default format. -/// - `f`: delegates to a method on the type named "format" with the signature `fn (*Writer, args: anytype) Writer.Error!void`. +/// - `f`: delegates to a method on the type named "format" with the signature `fn (self, *Writer) Writer.Error!void`. +/// See also `std.fmt.Alt`. /// /// A user type may be a `struct`, `vector`, `union` or `enum` type. ///