From 31c80cacb114d64dff1ca2fbbe88e5bd781fe915 Mon Sep 17 00:00:00 2001 From: Tomasz Pietrek Date: Mon, 29 Apr 2024 17:06:50 +0200 Subject: [PATCH] Apply lint Signed-off-by: Tomasz Pietrek --- Sources/JetStream/context.swift | 8 +++++--- Sources/JetStream/errors.swift | 2 +- Tests/JetStreamTests/Integration/JetStreamTests.swift | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/JetStream/context.swift b/Sources/JetStream/context.swift index 58aec59..357ca6f 100644 --- a/Sources/JetStream/context.swift +++ b/Sources/JetStream/context.swift @@ -53,11 +53,13 @@ extension JetStreamContext { return AckFuture(sub: sub, timeout: self.timeout) } - internal func request(_ subject: String, message: Data) async throws -> Response { - let response = try await self.client.request(message, subject: "\(self.prefix).\(subject)", timeout: self.timeout) + internal func request(_ subject: String, message: Data) async throws -> Response + { + let response = try await self.client.request( + message, subject: "\(self.prefix).\(subject)", timeout: self.timeout) let decoder = JSONDecoder() - // maybe empty is ok if the response type is nil and we can skip this check? + // maybe empty is ok if the response type is nil and we can skip this check? guard let payload = response.payload else { throw JetStreamRequestError("empty response payload") } diff --git a/Sources/JetStream/errors.swift b/Sources/JetStream/errors.swift index f454937..7db1fd1 100644 --- a/Sources/JetStream/errors.swift +++ b/Sources/JetStream/errors.swift @@ -534,5 +534,5 @@ public enum Response: Codable { } func test() { -// JetStreamError(code: 400, errorCode: ErrorCode.accountResourcesExceeded, description: nil) + // JetStreamError(code: 400, errorCode: ErrorCode.accountResourcesExceeded, description: nil) } diff --git a/Tests/JetStreamTests/Integration/JetStreamTests.swift b/Tests/JetStreamTests/Integration/JetStreamTests.swift index 6d98192..b485bf8 100644 --- a/Tests/JetStreamTests/Integration/JetStreamTests.swift +++ b/Tests/JetStreamTests/Integration/JetStreamTests.swift @@ -93,7 +93,8 @@ class JetStreamTests: XCTestCase { } XCTAssertEqual(info.streams, 1) - let badInfo: Response = try await ctx.request("STREAM.INFO.BAD", message: Data()) + let badInfo: Response = try await ctx.request( + "STREAM.INFO.BAD", message: Data()) guard case .error(let jetStreamAPIResponse) = badInfo else { XCTFail("should get error") return @@ -101,6 +102,5 @@ class JetStreamTests: XCTestCase { XCTAssertEqual(ErrorCode.streamNotFound, jetStreamAPIResponse.error.errorCode) - } }