From 2822e64ce1c95afc16c1cd220494faf348fd2f91 Mon Sep 17 00:00:00 2001 From: David Nadoba Date: Tue, 30 Nov 2021 18:33:32 +0100 Subject: [PATCH] fix nits from #501 --- Sources/AsyncHTTPClient/ConnectionPool.swift | 2 +- .../ChannelHandler/HTTP1ProxyConnectHandler.swift | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Sources/AsyncHTTPClient/ConnectionPool.swift b/Sources/AsyncHTTPClient/ConnectionPool.swift index 07605d2d7..291068c55 100644 --- a/Sources/AsyncHTTPClient/ConnectionPool.swift +++ b/Sources/AsyncHTTPClient/ConnectionPool.swift @@ -74,7 +74,7 @@ enum ConnectionPool { var hasher = Hasher() self.tlsConfiguration?.hash(into: &hasher) let hash = hasher.finalize() - var hostDescription = "" + let hostDescription: String switch self.connectionTarget { case .ipAddress(let serialization, let addr): hostDescription = "\(serialization):\(addr.port!)" diff --git a/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift b/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift index 46d119929..7340a59ea 100644 --- a/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift +++ b/Sources/AsyncHTTPClient/ConnectionPool/ChannelHandler/HTTP1ProxyConnectHandler.swift @@ -45,10 +45,11 @@ final class HTTP1ProxyConnectHandler: ChannelDuplexHandler, RemovableChannelHand return self.proxyEstablishedPromise?.futureResult } - convenience - init(target: ConnectionTarget, - proxyAuthorization: HTTPClient.Authorization?, - deadline: NIODeadline) { + convenience init( + target: ConnectionTarget, + proxyAuthorization: HTTPClient.Authorization?, + deadline: NIODeadline + ) { let targetHost: String let targetPort: Int switch target {