From e86aa559a4a59f9d077a3d98aa624c591951e3e7 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Tue, 19 Aug 2025 23:32:46 -0700 Subject: [PATCH] Remove unchecked sendable (#617) --- .../Packages/Sources/SecretAgentKit/Sendability.swift | 11 ----------- .../Sources/SecretAgentKit/SocketController.swift | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 Sources/Packages/Sources/SecretAgentKit/Sendability.swift diff --git a/Sources/Packages/Sources/SecretAgentKit/Sendability.swift b/Sources/Packages/Sources/SecretAgentKit/Sendability.swift deleted file mode 100644 index 5338464..0000000 --- a/Sources/Packages/Sources/SecretAgentKit/Sendability.swift +++ /dev/null @@ -1,11 +0,0 @@ -import Foundation - -struct UncheckedSendable: @unchecked Sendable { - - let value: T - - init(_ value: T) { - self.value = value - } - -} diff --git a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift index a51951f..acaf542 100644 --- a/Sources/Packages/Sources/SecretAgentKit/SocketController.swift +++ b/Sources/Packages/Sources/SecretAgentKit/SocketController.swift @@ -82,12 +82,12 @@ public final class SocketController { logger.debug("Socket controller has new data available") guard let new = notification.object as? FileHandle else { return } logger.debug("Socket controller received new file handle") - Task { [handler, logger = UncheckedSendable(logger)] in + Task { [handler, logger = logger] in if((await handler?(new, new)) == true) { - logger.value.debug("Socket controller handled data, wait for more data") + logger.debug("Socket controller handled data, wait for more data") await new.waitForDataInBackgroundAndNotifyOnMainActor() } else { - logger.value.debug("Socket controller called with empty data, socked closed") + logger.debug("Socket controller called with empty data, socked closed") } } }