From 26a8e5b2e57014707491f8166d54d564981966e0 Mon Sep 17 00:00:00 2001 From: "Mr. Ming" Date: Thu, 4 Feb 2021 22:04:37 +0800 Subject: [PATCH] T.self -> type --- Sources/Codextended/Codextended.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Codextended/Codextended.swift b/Sources/Codextended/Codextended.swift index 36efad0..f6e4a5f 100644 --- a/Sources/Codextended/Codextended.swift +++ b/Sources/Codextended/Codextended.swift @@ -81,7 +81,7 @@ public extension Data { /// If no explicit encoder is passed, then the data is decoded as JSON. func decoded(as type: T.Type = T.self, using decoder: AnyDecoder = JSONDecoder()) throws -> T { - return try decoder.decode(T.self, from: self) + return try decoder.decode(type, from: self) } }