Skip to content
Snippets Groups Projects
Commit 98585779 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Refactor

parent 29d11015
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
......@@ -27,7 +27,7 @@ extension EventReport: Codable {
case details = "Details"
}
public static func decode(_ data: Data) throws -> EventReport {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
......@@ -19,7 +19,7 @@ extension Fact: Codable {
case type = "Type"
}
public static func decode(_ data: Data) throws -> Fact {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......@@ -29,7 +29,7 @@ extension Fact: Codable {
}
extension Array where Element == Fact {
public static func decode(_ data: Data) throws -> [Fact] {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
......@@ -47,7 +47,7 @@ extension Message: Codable {
case roundId = "RoundId"
}
public static func decode(_ data: Data) throws -> Message {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
......@@ -23,7 +23,7 @@ extension MessageSendReport: Codable {
case timestamp = "Timestamp"
}
public static func decode(_ data: Data) throws -> MessageSendReport {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
......@@ -27,7 +27,7 @@ extension ReceptionIdentity: Codable {
case dhKeyPrivate = "DHKeyPrivate"
}
public static func decode(_ data: Data) throws -> ReceptionIdentity {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
......@@ -35,7 +35,7 @@ extension RestlikeMessage: Codable {
case error = "Error"
}
public static func decode(_ data: Data) throws -> RestlikeMessage {
public static func decode(_ data: Data) throws -> Self {
try JSONDecoder().decode(Self.self, from: data)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment