Advertisement
Guest User

Untitled

a guest
Mar 21st, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1.  
  2. pub fn noMarshallFn(comptime t: var, allocator: *Allocator) []const u8 {
  3. const constt = t;
  4. const typeSize = @sizeOf(@TypeOf(t));
  5. const arr = @ptrCast(*const [typeSize]u8, &constt);
  6. const bytesAsSlice = mem.bytesAsSlice(u8, arr);
  7. return bytesAsSlice;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement