diff --git a/src/encoder.zig b/src/encoder.zig index 4cd42ac..5a4c237 100644 --- a/src/encoder.zig +++ b/src/encoder.zig @@ -267,8 +267,7 @@ pub fn encode(value: anytype, buffer: []u8) !usize { return encodeArray(array_info.child, slice, buffer, encode); } - std.debug.print("Unsupported type: {s}\n", .{@typeName(T)}); - return error.UnsupportedType; + @compileError("Unsupported pointer type for SCALE encoding: " ++ @typeName(T)); }, .optional => |info| { return encodeOption(info.child, value, buffer, encode); @@ -280,8 +279,7 @@ pub fn encode(value: anytype, buffer: []u8) !usize { return encodeTaggedUnion(T, value, buffer); }, else => { - std.debug.print("Unsupported type: {s}\n", .{@typeName(T)}); - return error.UnsupportedType; + @compileError("Unsupported type for SCALE encoding: " ++ @typeName(T)); }, }; } diff --git a/src/util.zig b/src/util.zig index 612a4f6..767118a 100644 --- a/src/util.zig +++ b/src/util.zig @@ -50,8 +50,7 @@ pub fn calculateEncodedSize(value: anytype) !usize { } } - std.debug.print("Unsupported type: {s}, {any}\n", .{ @typeName(T), @typeInfo(T) }); - return error.UnsupportedType; + @compileError("Unsupported pointer type for SCALE size calculation: " ++ @typeName(T)); }, .optional => { const base_size = 1; @@ -84,8 +83,7 @@ pub fn calculateEncodedSize(value: anytype) !usize { return size; }, else => { - std.debug.print("Unsupported type: {s}\n", .{@typeName(T)}); - return error.UnsupportedType; + @compileError("Unsupported type for SCALE size calculation: " ++ @typeName(T)); }, }; }