From 552e30b3f36bb7a4c17d7e194d4e3b5a28fa05e0 Mon Sep 17 00:00:00 2001 From: Thomas Rademaker Date: Tue, 13 Sep 2022 07:25:51 -0400 Subject: [PATCH] use new generic style for new methods just merged from main --- Sources/MongoManager/MongoManager.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MongoManager/MongoManager.swift b/Sources/MongoManager/MongoManager.swift index 98db9bd..f6582dc 100644 --- a/Sources/MongoManager/MongoManager.swift +++ b/Sources/MongoManager/MongoManager.swift @@ -43,7 +43,7 @@ public struct MongoManager { } /// unwrap your `Codable` array from the MongoDB Document object - public static func unwrapDocuments(_ documents: MongoDocuments) -> C { + public static func unwrapDocuments(_ documents: MongoDocuments) -> some Codable { documents.documents } @@ -51,7 +51,7 @@ public struct MongoManager { /// - Parameters res: A `FetchResponse` object to decode /// - Returns an array of objects conforming to `Codable` public static func decodeDocuments(from res: FetchResponse) async throws -> C { - unwrapDocuments(try await res.body.decode(MongoDocuments.self)) + try await res.body.decode(MongoDocuments.self).documents } private static func headers(for data: MongoData) -> [String : String] {