From 2ba0f8a668c14e49d1d1a3d6edad8b807ea250cd Mon Sep 17 00:00:00 2001 From: Andrew Breckenridge Date: Thu, 25 Apr 2024 10:12:10 -0700 Subject: [PATCH] DataLoader: don't wrap an already Encodable value in AnyEncodable i don't understand what this extra wrap does. the value is already `Encodable` so it should be possible to directly encode it --- Sources/Get/DataLoader.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Get/DataLoader.swift b/Sources/Get/DataLoader.swift index 000696b..8e557d5 100644 --- a/Sources/Get/DataLoader.swift +++ b/Sources/Get/DataLoader.swift @@ -357,7 +357,7 @@ func encode(_ value: Encodable, using encoder: JSONEncoder) async throws -> Data return string.data(using: .utf8) } else { return try await Task.detached { - try encoder.encode(AnyEncodable(value: value)) + try encoder.encode(value) }.value } }