std.net: use mem.toBytes

This commit is contained in:
Luna 2019-12-01 13:23:43 -03:00 committed by Andrew Kelley
parent 50e6a27c29
commit 0d852effe3
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -1326,12 +1326,11 @@ pub const StreamServer = struct {
}
if (self.reuse_address) {
var opt = [_]u8{1} ** @sizeOf(c_int);
try os.setsockopt(
self.sockfd.?,
os.SOL_SOCKET,
os.SO_REUSEADDR,
&opt,
&mem.toBytes(@as(c_int, 1)),
);
}