commit 7cfe854359bcacb038654903fbe8a17c4144c3d5 (tree)
parent 6fa143355f256e354a2df67a42e3e9208d1a71e9
Author: Andrew Kelley <andrew@ziglang.org>
Date: Mon, 24 Feb 2020 22:34:06 -0500
clean up std.Buffer.print
Diffstat:
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/lib/std/buffer.zig b/lib/std/buffer.zig
@@ -149,13 +149,7 @@ pub const Buffer = struct {
}
pub fn print(self: *Buffer, comptime fmt: []const u8, args: var) !void {
- try std.fmt.format(
- self,
- @typeInfo(@TypeOf(Buffer.append)).Fn.return_type.?.ErrorSet,
- Buffer.append,
- fmt,
- args,
- );
+ return std.fmt.format(self, error{OutOfMemory}, Buffer.append, fmt, args);
}
};