Skip to content

Commit 79757dc

Browse files
committed
Merge branch 'swifty-append' into 'master'
Swap `append(_:to:)` parameters in signature See merge request Mordil/swift-redis-nio-client!62
2 parents 0facb90 + 8c67681 commit 79757dc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/RedisNIO/Commands/StringCommands.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ extension RedisClient {
8989
.map { return $0 == 1 }
9090
}
9191

92-
/// Append a value to the end of an existing entry
93-
/// - Note: If the key does not exist it is created and set as an empty string, so APPEND will be similar to SET in this special case.
92+
/// Append a value to the end of an existing entry.
93+
/// - Note: If the key does not exist, it is created and set as an empty string, so `APPEND` will be similar to `SET` in this special case.
9494
///
95-
/// [https://redis.io/commands/append](https://redis.io/commands/append)
95+
/// See [https://redis.io/commands/append](https://redis.io/commands/append)
9696
/// - Parameters:
97+
/// - value: The value to append onto the value stored at the key.
9798
/// - key: The key to use to uniquely identify this value.
98-
/// - value: The value to append the key to.
99-
/// - Returns: Integer with the new length of the value
99+
/// - Returns: The length of the key's value after appending the additional value.
100100
@inlinable
101-
public func append(_ key: String, to value: RESPValueConvertible) -> EventLoopFuture<Int> {
101+
public func append(_ value: RESPValueConvertible, to key: String) -> EventLoopFuture<Int> {
102102
return send(command: "APPEND", with: [key, value])
103103
.convertFromRESPValue()
104104
}

Tests/RedisNIOTests/Commands/StringCommandsTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ final class StringCommandsTests: XCTestCase {
6161

6262
func test_append() throws {
6363
let result = "value appended"
64-
XCTAssertNoThrow(try connection.append(#function, to: "value").wait())
65-
let length = try connection.append(#function, to: " appended").wait()
64+
XCTAssertNoThrow(try connection.append("value", to: #function).wait())
65+
let length = try connection.append(" appended", to: #function).wait()
6666
XCTAssertEqual(length, result.count)
6767
let val = try connection.get(#function).wait()
6868
XCTAssertEqual(val, result)

0 commit comments

Comments
 (0)