File tree Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Expand file tree Collapse file tree 4 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ let package = Package(
2727 . library(
2828 name: " ETCD " ,
2929 targets: [ " ETCD " ]
30- ) ,
30+ )
3131 ] ,
3232 dependencies: [
3333 . package ( url: " https://github.com/apple/swift-nio.git " , from: " 2.56.0 " ) ,
Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ public struct DeleteRangeRequest {
1919 public var key : Data
2020 public var rangeEnd : Data ?
2121 public var prevKV : Bool = false
22-
22+
2323 init ( protoDeleteRangeRequest: Etcdserverpb_DeleteRangeRequest ) {
2424 self . key = protoDeleteRangeRequest. key
2525 self . rangeEnd = protoDeleteRangeRequest. rangeEnd. isEmpty ? nil : protoDeleteRangeRequest. rangeEnd
2626 self . prevKV = protoDeleteRangeRequest. prevKv
2727 }
28-
28+
2929 /// Struct representing a deleteRangeRequest in etcd.
3030 ///
3131 /// - Parameters:
@@ -37,7 +37,7 @@ public struct DeleteRangeRequest {
3737 self . rangeEnd = rangeEnd
3838 self . prevKV = prevKV
3939 }
40-
40+
4141 func toProto( ) -> Etcdserverpb_DeleteRangeRequest {
4242 var protoDeleteRangeRequest = Etcdserverpb_DeleteRangeRequest ( )
4343 protoDeleteRangeRequest. key = self . key
Original file line number Diff line number Diff line change @@ -110,7 +110,10 @@ public final class EtcdClient: @unchecked Sendable {
110110 /// - Parameters:
111111 /// - key: The key for which the value is watched. Parameter is of type Sequence<UInt8>.
112112 /// - operation: The operation to be run on the WatchAsyncSequence for the key.
113- public func watch< Result> ( _ key: some Sequence < UInt8 > , _ operation: ( WatchAsyncSequence ) async throws -> Result ) async throws -> Result {
113+ public func watch< Result> (
114+ _ key: some Sequence < UInt8 > ,
115+ _ operation: ( WatchAsyncSequence ) async throws -> Result
116+ ) async throws -> Result {
114117 let request = [ Etcdserverpb_WatchRequest . with { $0. createRequest. key = Data ( key) } ]
115118 let watchAsyncSequence = WatchAsyncSequence ( grpcAsyncSequence: watchClient. watch ( request) )
116119 return try await operation ( watchAsyncSequence)
@@ -121,7 +124,10 @@ public final class EtcdClient: @unchecked Sendable {
121124 /// - Parameters:
122125 /// - key: The key for which the value is watched. Parameter is of type String.
123126 /// - operation: The operation to be run on the WatchAsyncSequence for the key.
124- public func watch< Result> ( _ key: String , _ operation: ( WatchAsyncSequence ) async throws -> Result ) async throws -> Result {
127+ public func watch< Result> (
128+ _ key: String ,
129+ _ operation: ( WatchAsyncSequence ) async throws -> Result
130+ ) async throws -> Result {
125131 try await watch ( key. utf8, operation)
126132 }
127133}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ final class EtcdClientTests: XCTestCase {
5454
5555 let deleteRangeRequest = DeleteRangeRequest ( key: rangeRequestKey)
5656 try await etcdClient. deleteRange ( deleteRangeRequest)
57-
57+
5858 fetchedValue = try await etcdClient. getRange ( rangeRequest)
5959 XCTAssertNil ( fetchedValue)
6060 }
@@ -68,7 +68,7 @@ final class EtcdClientTests: XCTestCase {
6868
6969 let deleteRangeRequest = DeleteRangeRequest ( key: key)
7070 try await etcdClient. deleteRange ( deleteRangeRequest)
71-
71+
7272 fetchedValue = try await etcdClient. getRange ( rangeRequest)
7373 XCTAssertNil ( fetchedValue)
7474 }
You can’t perform that action at this time.
0 commit comments