Skip to content

Commit

Permalink
Codable & Hashable on failable codables
Browse files Browse the repository at this point in the history
  • Loading branch information
skydemarcoa committed Nov 26, 2019
1 parent 4a139e9 commit 137bdb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ReactiveAPI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.10.0;
MARKETING_VERSION = 1.10.1;
PRODUCT_BUNDLE_IDENTIFIER = it.sky.ReactiveAPI;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -827,7 +827,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.10.0;
MARKETING_VERSION = 1.10.1;
PRODUCT_BUNDLE_IDENTIFIER = it.sky.ReactiveAPI;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -856,7 +856,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.9.2;
MARKETING_VERSION = 1.10.1;
PRODUCT_BUNDLE_IDENTIFIER = it.sky.ReactiveAPIExt;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -885,7 +885,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.9.2;
MARKETING_VERSION = 1.10.1;
PRODUCT_BUNDLE_IDENTIFIER = it.sky.ReactiveAPIExt;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
Expand Down
8 changes: 4 additions & 4 deletions ReactiveAPIExt/FailableCodables.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

public struct FailableCodable<Base: Codable>: Codable {
let base: Base?
public struct FailableCodable<Base: Codable & Hashable>: Codable, Hashable {
public let base: Base?

public init(from decoder: Decoder) throws {
let container = try decoder.singleValueContainer()
Expand All @@ -14,10 +14,10 @@ public struct FailableCodable<Base: Codable>: Codable {
}
}

public struct FailableCodableArray<Element: Codable>: Codable {
public struct FailableCodableArray<Element: Codable & Hashable>: Codable, Hashable {
public let elements: [Element]

public init(elements: [Element]) {
init(elements: [Element]) {
self.elements = elements
}

Expand Down
4 changes: 2 additions & 2 deletions ReactiveAPIExtTests/FailableCodableArrayTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import XCTest
@testable import ReactiveAPIExt

final class FailableCodableArrayTests: XCTestCase {
struct Root: Codable {
struct Root: Codable, Hashable {
let items: FailableCodableArray<SUT>
}

struct SUT: Codable, Equatable {
struct SUT: Codable, Hashable {
enum Foobar: String, Codable {
case foo, bar
}
Expand Down

0 comments on commit 137bdb9

Please sign in to comment.