Commit 7cfe854359

Andrew Kelley <andrew@ziglang.org>
2020-02-25 04:34:06
clean up std.Buffer.print
1 parent 6fa1433
Changed files (1)
lib
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);
     }
 };