thunk: fix slightly confusing compile errors

The error messages not on the slice detection code path should not be
talking about slices.
This commit is contained in:
torque 2024-04-06 15:01:03 -07:00
parent b17a3fba6c
commit 42d0b24710
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -23,7 +23,7 @@ pub fn checkUserDataType(comptime T: type) void {
.Optional => |info| switch (@typeInfo(info.child)) { .Optional => |info| switch (@typeInfo(info.child)) {
.Optional => @compileError( .Optional => @compileError(
"nats callbacks can only accept an (optional) single, many," ++ "nats callbacks can only accept an (optional) single, many," ++
" or c pointer as userdata, not slices. \"" ++ " or c pointer as userdata. \"" ++
@typeName(T) ++ "\" has more than one optional specifier.", @typeName(T) ++ "\" has more than one optional specifier.",
), ),
else => checkUserDataType(info.child), else => checkUserDataType(info.child),
@ -38,7 +38,7 @@ pub fn checkUserDataType(comptime T: type) void {
}, },
else => @compileError( else => @compileError(
"nats callbacks can only accept an (optional) single, many," ++ "nats callbacks can only accept an (optional) single, many," ++
" or c pointer as userdata, not slices. \"" ++ " or c pointer as userdata. \"" ++
@typeName(T) ++ "\" is not a pointer type.", @typeName(T) ++ "\" is not a pointer type.",
), ),
} }