From 921bcef05dfa9d92e475419d72b1751d2b5463fa Mon Sep 17 00:00:00 2001 From: Mathew Polzin Date: Tue, 27 Nov 2018 18:39:57 -0800 Subject: [PATCH] Ids are now Hashable --- Sources/JSONAPI/Resource/Id.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/JSONAPI/Resource/Id.swift b/Sources/JSONAPI/Resource/Id.swift index 921bd46..2627617 100644 --- a/Sources/JSONAPI/Resource/Id.swift +++ b/Sources/JSONAPI/Resource/Id.swift @@ -8,7 +8,7 @@ /// Any type that you would like to be encoded to and /// decoded from JSON API ids should conform to this /// protocol. Conformance for `String` is given. -public protocol RawIdType: Codable, Equatable {} +public protocol RawIdType: Codable, Hashable {} /// If you would like to be able to create new /// Entities with Ids backed by a RawIdType then @@ -32,7 +32,7 @@ public struct Unidentified: Identi public var description: String { return "Id(Unidentified)" } } -public protocol IdType: Identifier, CustomStringConvertible { +public protocol IdType: Identifier, Hashable, CustomStringConvertible { associatedtype RawType: RawIdType var rawValue: RawType { get }