From aaf67ab9df487f2b726005698fbea3d79e612704 Mon Sep 17 00:00:00 2001 From: faimin Date: Mon, 15 Sep 2025 16:34:42 +0800 Subject: [PATCH] SmartIgnored implement the Hashable & Equatable --- .../Core/PropertyWrapper/SmartIgnored.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sources/SmartCodable/Core/PropertyWrapper/SmartIgnored.swift b/Sources/SmartCodable/Core/PropertyWrapper/SmartIgnored.swift index c94b732..4bdaf34 100644 --- a/Sources/SmartCodable/Core/PropertyWrapper/SmartIgnored.swift +++ b/Sources/SmartCodable/Core/PropertyWrapper/SmartIgnored.swift @@ -62,6 +62,17 @@ public struct SmartIgnored: PropertyWrapperable { } } +extension SmartIgnored: Equatable where T: Equatable { + public static func == (lhs: Self, rhs: Self) -> Bool { + return lhs.wrappedValue == rhs.wrappedValue + } +} + +extension SmartIgnored: Hashable where T: Hashable { + public func hash(into hasher: inout Hasher) { + wrappedValue.hash(into: &hasher) + } +} extension SmartIgnored: Codable { public init(from decoder: Decoder) throws {