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 {
138
138
case ( . bulkString( let lhs) , . bulkString( let rhs) ) : return lhs == rhs
139
139
case ( . simpleString( let lhs) , . simpleString( let rhs) ) : return lhs == rhs
140
140
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
142
142
case ( . array( let lhs) , . array( let rhs) ) : return lhs == rhs
143
143
case ( . null, . null) : return true
144
144
default : return false
Original file line number Diff line number Diff line change @@ -37,12 +37,16 @@ public enum RedisClientError: LocalizedError {
37
37
}
38
38
39
39
/// 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 {
41
41
public let message : String
42
42
43
43
public var errorDescription : String ? { return message }
44
44
45
45
public init ( reason: String ) {
46
46
message = " Redis: \( reason) "
47
47
}
48
+
49
+ public static func == ( lhs: RedisError , rhs: RedisError ) -> Bool {
50
+ return lhs. message == rhs. message
51
+ }
48
52
}
Original file line number Diff line number Diff line change @@ -299,9 +299,3 @@ extension RedisByteDecoderTests {
299
299
return try decoder. decode ( context: context, buffer: & buffer)
300
300
}
301
301
}
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