From 296374ecef32aa2fd27cd6fd57a4c62aaf733d07 Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Wed, 21 Dec 2022 11:46:06 -0800 Subject: [PATCH] Label tuple contents for allocatePortPair() and relinquish() --- Sources/System/MachPort.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/System/MachPort.swift b/Sources/System/MachPort.swift index cf5ca1b..a2cbe50 100644 --- a/Sources/System/MachPort.swift +++ b/Sources/System/MachPort.swift @@ -109,7 +109,7 @@ enum Mach { /// /// This function will abort if the rights could not be created. /// Callers may assert that valid rights are always returned. - static func allocatePortRightPair() -> (Mach.Port, Mach.Port) { + static func allocatePortRightPair() -> (receive: Mach.Port, send: Mach.Port) { var name = mach_port_name_t(MACH_PORT_NULL) let secret = mach_port_context_t(arc4random()) withUnsafeMutablePointer(to: &name) { name in @@ -165,8 +165,8 @@ extension Mach.Port where RightType == Mach.ReceiveRight { /// /// After this function completes, the Mach.Port is destroyed and no longer /// usable. - __consuming func relinquish() -> (mach_port_name_t, mach_port_context_t) { - return (name, context) + __consuming func relinquish() -> (name: mach_port_name_t, context: mach_port_context_t) { + return (name: name, context: context) } /// Remove guard and transfer ownership of the underlying port right to