From 5d7ebd6e3e579d4e3cae9df548b83f11726c53e3 Mon Sep 17 00:00:00 2001 From: Corey Baker Date: Wed, 10 Jul 2024 18:25:32 -0700 Subject: [PATCH] More Sendable --- Sources/ParseSwift/Objects/ParseInstallation.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Sources/ParseSwift/Objects/ParseInstallation.swift b/Sources/ParseSwift/Objects/ParseInstallation.swift index 25a71f4cd..b9ea64e7b 100644 --- a/Sources/ParseSwift/Objects/ParseInstallation.swift +++ b/Sources/ParseSwift/Objects/ParseInstallation.swift @@ -747,8 +747,9 @@ extension ParseInstallation { let acl = try? await ParseACL.defaultACL() { object.ACL = acl } - let mapper = { (data) -> Self in - try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: object) + let updatedObject = object + let mapper = { @Sendable (data) -> Self in + try ParseCoding.jsonDecoder().decode(CreateResponse.self, from: data).apply(to: updatedObject) } return API.Command(method: .POST, path: try await endpoint(.POST), @@ -761,7 +762,7 @@ extension ParseInstallation { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedObject = self updatedObject.originalData = nil updatedObject = try ParseCoding.jsonDecoder().decode(ReplaceResponse.self, @@ -786,7 +787,7 @@ extension ParseInstallation { throw ParseError(code: .missingObjectId, message: "objectId must not be nil") } - let mapper = { (data: Data) -> Self in + let mapper = { @Sendable (data: Data) -> Self in var updatedObject = self updatedObject.originalData = nil updatedObject = try ParseCoding.jsonDecoder().decode(UpdateResponse.self,