Skip to content

Commit

Permalink
DataLoader: don't wrap an already Encodable value in AnyEncodable
Browse files Browse the repository at this point in the history
i don't understand what this extra wrap does. the value is already `Encodable` so it should be possible to directly encode it
  • Loading branch information
AndrewSB authored Apr 25, 2024
1 parent 74dba20 commit 2ba0f8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Get/DataLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 2ba0f8a

Please sign in to comment.