So I have this code but the type system is too strict, I want to allow all *const [n:0]u8 but it only works when you specify a length and the sentinel value like *const [3:0]u8 in this case.
https://godbolt.org/z/aT8a5cff9
#How to compare string types in a more lenient way?
1 messages · Page 1 of 1 (latest)
byte the bullet and just allow []const u8
just cast to []const u8 and let the compiler generate the error
mk
but if you did want to check, std.meta.Elem(field.field_type) == u8 gets you pretty close
how would I cast it? I'm unfamiliar with zig's ways and ive seen many builtin functions to do it
just column[i].name = column_names[i];