Skip to content

Commit

Permalink
std.net: replace @ptrCast with slice syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sno2 authored and andrewrk committed Nov 28, 2023
1 parent a0fbc68 commit a98d4a6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/std/net.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,7 @@ fn linuxLookupName(
key |= DAS_USABLE;
os.getsockname(fd, sa, &salen) catch break :syscalls;
if (addr.addr.any.family == os.AF.INET) {
// TODO sa6.addr[12..16] should return *[4]u8, making this cast unnecessary.
mem.writeInt(u32, @as(*[4]u8, @ptrCast(&sa6.addr[12])), sa4.addr, native_endian);
mem.writeInt(u32, sa6.addr[12..16], sa4.addr, native_endian);
}
if (dscope == @as(i32, scopeOf(sa6.addr))) key |= DAS_MATCHINGSCOPE;
if (dlabel == labelOf(sa6.addr)) key |= DAS_MATCHINGLABEL;
Expand Down

0 comments on commit a98d4a6

Please sign in to comment.