File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
Tests/RediStackTests/ChannelHandlers Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ extension RESPValue: Equatable {
138138 case ( . bulkString( let lhs) , . bulkString( let rhs) ) : return lhs == rhs
139139 case ( . simpleString( let lhs) , . simpleString( let rhs) ) : return lhs == rhs
140140 case ( . integer( let lhs) , . integer( let rhs) ) : return lhs == rhs
141- case ( . error( let lhs) , . error( let rhs) ) : return lhs. message == rhs. message
141+ case ( . error( let lhs) , . error( let rhs) ) : return lhs == rhs
142142 case ( . array( let lhs) , . array( let rhs) ) : return lhs == rhs
143143 case ( . null, . null) : return true
144144 default : return false
Original file line number Diff line number Diff line change @@ -37,12 +37,16 @@ public enum RedisClientError: LocalizedError {
3737}
3838
3939/// If something goes wrong with a command within Redis, it will respond with an error that is captured and represented by instances of this type.
40- public struct RedisError : LocalizedError {
40+ public struct RedisError : LocalizedError , Equatable {
4141 public let message : String
4242
4343 public var errorDescription : String ? { return message }
4444
4545 public init ( reason: String ) {
4646 message = " Redis: \( reason) "
4747 }
48+
49+ public static func == ( lhs: RedisError , rhs: RedisError ) -> Bool {
50+ return lhs. message == rhs. message
51+ }
4852}
Original file line number Diff line number Diff line change @@ -299,9 +299,3 @@ extension RedisByteDecoderTests {
299299 return try decoder. decode ( context: context, buffer: & buffer)
300300 }
301301}
302-
303- extension RedisError : Equatable {
304- public static func == ( lhs: RedisError , rhs: RedisError ) -> Bool {
305- return lhs. message == rhs. message
306- }
307- }
You can’t perform that action at this time.
0 commit comments