mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Refactoring
This commit is contained in:
14
submodules/TelegramCore/Sources/Utils/Coding.swift
Normal file
14
submodules/TelegramCore/Sources/Utils/Coding.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
|
||||
public final class EngineEncoder {
|
||||
public static func encode(_ value: Encodable) throws -> Data {
|
||||
return try AdaptedPostboxEncoder().encode(value)
|
||||
}
|
||||
}
|
||||
|
||||
public final class EngineDecoder {
|
||||
public static func decode<T>(_ type: T.Type, from data: Data) throws -> T where T : Decodable {
|
||||
return try AdaptedPostboxDecoder().decode(type, from: data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user