Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub fn noMarshallFn(comptime t: var, allocator: *Allocator) []const u8 {
- const constt = t;
- const typeSize = @sizeOf(@TypeOf(t));
- const arr = @ptrCast(*const [typeSize]u8, &constt);
- const bytesAsSlice = mem.bytesAsSlice(u8, arr);
- return bytesAsSlice;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement