Skip to content

Commit 93e4864

Browse files
committed
Rename RedisData.basicString to .simpleString to be consistent throughout code and Redis RESP protocol names
1 parent 095735c commit 93e4864

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/NIORedis/Coders/RedisDataDecoder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extension RedisDataDecoder {
5252
switch token {
5353
case .plus:
5454
guard let string = try _parseSimpleString(at: &position, from: &buffer) else { return .notYetParsed }
55-
return .parsed(.basicString(string))
55+
return .parsed(.simpleString(string))
5656

5757
case .colon:
5858
guard let number = try _parseInteger(at: &position, from: &buffer) else { return .notYetParsed }
@@ -135,7 +135,7 @@ extension RedisDataDecoder {
135135
// since size = 0, and we successfully parsed the size
136136
// the beginning of the next message should be 2 further (the final \r\n - $0\r\n\r\n)
137137
position += 2
138-
return .parsed(.bulkString("".convertedToData()))
138+
return .parsed(.bulkString(Data()))
139139
}
140140

141141
// verify that we have at least our expected bulk string message

Sources/NIORedis/Data/RedisData.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Foundation
55
/// See: https://redis.io/topics/protocol
66
public enum RedisData {
77
case null
8-
case basicString(String)
8+
case simpleString(String)
99
case bulkString(Data)
1010
case error(RedisError)
1111
case integer(Int)
@@ -46,7 +46,7 @@ extension RedisData {
4646
/// Extracts the basic/bulk string as a `String`.
4747
var string: String? {
4848
switch self {
49-
case .basicString(let string): return string
49+
case .simpleString(let string): return string
5050
case .bulkString(let data): return String(bytes: data, encoding: .utf8)
5151
default: return nil
5252
}

0 commit comments

Comments
 (0)