File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Sources/ComposableArchitecture/Effects Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -397,9 +397,28 @@ public struct UncheckedSendable<Value>: @unchecked Sendable {
397397 }
398398}
399399
400- extension UncheckedSendable : Equatable where Value: Equatable {
401- public static func == ( lhs: UncheckedSendable , rhs: UncheckedSendable ) -> Bool {
402- lhs. value == rhs. value
400+ extension UncheckedSendable : Equatable where Value: Equatable { }
401+ extension UncheckedSendable : Hashable where Value: Hashable { }
402+
403+ extension UncheckedSendable : Decodable where Value: Decodable {
404+ public init ( from decoder: Decoder ) throws {
405+ do {
406+ let container = try decoder. singleValueContainer ( )
407+ self . init ( wrappedValue: try container. decode ( Value . self) )
408+ } catch {
409+ self . init ( wrappedValue: try Value ( from: decoder) )
410+ }
411+ }
412+ }
413+
414+ extension UncheckedSendable : Encodable where Value: Encodable {
415+ public func encode( to encoder: Encoder ) throws {
416+ do {
417+ var container = encoder. singleValueContainer ( )
418+ try container. encode ( self . wrappedValue)
419+ } catch {
420+ try self . wrappedValue. encode ( to: encoder)
421+ }
403422 }
404423}
405424#endif
You can’t perform that action at this time.
0 commit comments