std: use mem.asBytes in Ip4Address.parse so it works at comptime

This commit is contained in:
daurnimator 2020-11-22 13:29:14 +11:00 committed by Andrew Kelley
parent 83abb32247
commit b7b3c1dfae

View File

@ -196,7 +196,7 @@ pub const Ip4Address = extern struct {
.addr = undefined,
},
};
const out_ptr = mem.sliceAsBytes(@as(*[1]u32, &result.sa.addr)[0..]);
const out_ptr = mem.asBytes(&result.sa.addr);
var x: u8 = 0;
var index: u8 = 0;