normal destructuring with one line changed

This commit is contained in:
2026-07-01 17:01:47 +02:00
parent bc4e09805b
commit 873aa3e1cc
8 changed files with 16 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ func net.listen[host: str, port: i64] : i64, bool
_builtin_syscall(SYS_close, s)
return -1, false
~packed_host, ok := net.resolve(host)
packed_host, ok := net.resolve(host)
if !ok
return -1, false
@@ -44,7 +44,7 @@ func net.connect[host: str, port: i64] : i64, bool
if s < 0
return -1, false
~packed_host, ok := net.resolve(host)
packed_host, ok := net.resolve(host)
if !ok
return -1, false
@@ -106,7 +106,7 @@ func net.UDPSocket.close_and_free[s: net.UDPSocket] : void
func net.create_udp_client[host: str, port: i64] : net.UDPSocket, bool
s := new* net.UDPSocket
~packed_host, ok := net.resolve(host)
packed_host, ok := net.resolve(host)
if !ok
return 0 as net.UDPSocket, false
@@ -120,7 +120,7 @@ func net.create_udp_client[host: str, port: i64] : net.UDPSocket, bool
return s, true
func net.create_udp_server[host: str, port: i64] : net.UDPSocket, bool
~s, ok := net.create_udp_client(host, port)
s, ok := net.create_udp_client(host, port)
if !ok
return 0 as net.UDPSocket, false
@@ -172,7 +172,7 @@ func net.resolve[domain: str] : i64, bool
query := net.build_dns_query(domain, DNS_TYPE_A)
// TODO: this probably shouldnt be hardcoded
~s, ok := net.create_udp_client("1.1.1.1", 53)
s, ok := net.create_udp_client("1.1.1.1", 53)
if !ok
query->free()
return -1, false