Skip to content

Commit 51e4db9

Browse files
committed
Fix HTTPClient warning
1 parent 233bd2a commit 51e4db9

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Sources/APNS/APNSClient.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import NIOCore
2222
import NIOHTTP1
2323
import NIOSSL
2424
import NIOTLS
25+
import NIOPosix
2526

2627
/// A client to talk with the Apple Push Notification services.
2728
public final class APNSClient<Decoder: APNSJSONDecoder, Encoder: APNSJSONEncoder>: APNSClientProtocol {
@@ -100,19 +101,17 @@ public final class APNSClient<Decoder: APNSJSONDecoder, Encoder: APNSJSONEncoder
100101
httpClientConfiguration.httpVersion = .automatic
101102
httpClientConfiguration.proxy = configuration.proxy
102103

103-
let httpClientEventLoopGroupProvider: HTTPClient.EventLoopGroupProvider
104-
105104
switch eventLoopGroupProvider {
106105
case .shared(let eventLoopGroup):
107-
httpClientEventLoopGroupProvider = .shared(eventLoopGroup)
106+
self.httpClient = HTTPClient(
107+
eventLoopGroupProvider: .shared(eventLoopGroup),
108+
configuration: httpClientConfiguration
109+
)
108110
case .createNew:
109-
httpClientEventLoopGroupProvider = .createNew
111+
self.httpClient = HTTPClient(
112+
configuration: httpClientConfiguration
113+
)
110114
}
111-
112-
self.httpClient = HTTPClient(
113-
eventLoopGroupProvider: httpClientEventLoopGroupProvider,
114-
configuration: httpClientConfiguration
115-
)
116115
}
117116

118117
/// Shuts down the client and event loop gracefully. This function is clearly an outlier in that it uses a completion

0 commit comments

Comments
 (0)