fix: use correct error type for cbor.writeErrorSet

This commit is contained in:
CJ van den Berg 2024-04-08 21:49:15 +02:00
parent a1040f0b5c
commit 71367c963b

View file

@ -152,9 +152,7 @@ fn writeNull(writer: anytype) @TypeOf(writer).Error!void {
}
fn writeErrorset(writer: anytype, err: anyerror) @TypeOf(writer).Error!void {
var buf: [256]u8 = undefined;
const errmsg = try bufPrint(&buf, "error.{s}", .{@errorName(err)});
return writeString(writer, errmsg);
try writer.print("error.{s}", .{@errorName(err)});
}
pub fn writeValue(writer: anytype, value: anytype) @TypeOf(writer).Error!void {