Skip to content

Commit 44dcb6c

Browse files
committed
swiftformat
1 parent 7a3d7b4 commit 44dcb6c

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Diff for: Sources/AsyncHTTPClient/ConnectionPool/HTTPConnectionPool+Factory.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension HTTPConnectionPool.ConnectionFactory {
5454
logger: Logger
5555
) -> EventLoopFuture<(Channel, HTTPVersion)> {
5656
let channelFuture: EventLoopFuture<(Channel, HTTPVersion)>
57-
57+
5858
if self.key.scheme.isProxyable, let proxy = self.clientConfiguration.proxy {
5959
switch proxy.type {
6060
case .socks:
@@ -63,19 +63,21 @@ extension HTTPConnectionPool.ConnectionFactory {
6363
connectionID: connectionID,
6464
deadline: deadline,
6565
eventLoop: eventLoop,
66-
logger: logger)
66+
logger: logger
67+
)
6768
case .http:
6869
channelFuture = self.makeHTTPProxyChannel(
6970
proxy,
7071
connectionID: connectionID,
7172
deadline: deadline,
7273
eventLoop: eventLoop,
73-
logger: logger)
74+
logger: logger
75+
)
7476
}
7577
} else {
7678
channelFuture = self.makeNonProxiedChannel(deadline: deadline, eventLoop: eventLoop, logger: logger)
7779
}
78-
80+
7981
// let's map `ChannelError.connectTimeout` into a `HTTPClientError.connectTimeout`
8082
return channelFuture.flatMapErrorThrowing { error throws -> (Channel, HTTPVersion) in
8183
switch error {

Diff for: Tests/AsyncHTTPClientTests/HTTPConnectionPool+FactoryTests.swift

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import NIOSOCKS
1919
import XCTest
2020

2121
class HTTPConnectionPool_FactoryTests: XCTestCase {
22-
2322
func testConnectionCreationTimesoutIfDeadlineIsInThePast() {
2423
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
2524
defer { XCTAssertNoThrow(try group.syncShutdownGracefully()) }
@@ -48,13 +47,13 @@ class HTTPConnectionPool_FactoryTests: XCTestCase {
4847
connectionID: 1,
4948
deadline: .now() - .seconds(1),
5049
eventLoop: group.next(),
51-
logger: .init(label: "test")).wait()
50+
logger: .init(label: "test")
51+
).wait()
5252
) {
5353
XCTAssertEqual($0 as? HTTPClientError, .connectTimeout)
5454
}
5555
}
5656

57-
5857
func testSOCKSConnectionCreationTimesoutIfRemoteIsUnresponsive() {
5958
let group = MultiThreadedEventLoopGroup(numberOfThreads: 1)
6059
defer { XCTAssertNoThrow(try group.syncShutdownGracefully()) }
@@ -83,7 +82,8 @@ class HTTPConnectionPool_FactoryTests: XCTestCase {
8382
connectionID: 1,
8483
deadline: .now() + .seconds(1),
8584
eventLoop: group.next(),
86-
logger: .init(label: "test")).wait()
85+
logger: .init(label: "test")
86+
).wait()
8787
) {
8888
XCTAssertEqual($0 as? HTTPClientError, .socksHandshakeTimeout)
8989
}
@@ -117,7 +117,8 @@ class HTTPConnectionPool_FactoryTests: XCTestCase {
117117
connectionID: 1,
118118
deadline: .now() + .seconds(1),
119119
eventLoop: group.next(),
120-
logger: .init(label: "test")).wait()
120+
logger: .init(label: "test")
121+
).wait()
121122
) {
122123
XCTAssertEqual($0 as? HTTPClientError, .httpProxyHandshakeTimeout)
123124
}
@@ -151,7 +152,8 @@ class HTTPConnectionPool_FactoryTests: XCTestCase {
151152
connectionID: 1,
152153
deadline: .now() + .seconds(1),
153154
eventLoop: group.next(),
154-
logger: .init(label: "test")).wait()
155+
logger: .init(label: "test")
156+
).wait()
155157
) {
156158
XCTAssertEqual($0 as? HTTPClientError, .tlsHandshakeTimeout)
157159
}

0 commit comments

Comments
 (0)