Skip to content

Commit c5c0e7b

Browse files
committed
SwiftFormat
1 parent ac67b22 commit c5c0e7b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/AsyncHTTPClient/FileDownloadDelegate.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
3333
private let io: NonBlockingFileIO
3434
private let reportHead: ((HTTPResponseHead) -> Void)?
3535
private let reportProgress: ((Progress) -> Void)?
36-
36+
3737
private enum ThreadPool {
3838
case unowned
3939
// if we own the thread pool we also need to shut it down
4040
case owned(NIOThreadPool)
4141
}
42+
4243
private let threadPool: ThreadPool
4344

4445
private var fileHandleFuture: EventLoopFuture<NIOFileHandle>?
@@ -62,7 +63,7 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
6263
) throws {
6364
try self.init(path: path, sharedThreadPool: pool, reportHead: reportHead, reportProgress: reportProgress)
6465
}
65-
66+
6667
/// Initializes a new file download delegate and spawns a new thread for file I/O.
6768
///
6869
/// - parameters:
@@ -79,7 +80,7 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
7980
) throws {
8081
try self.init(path: path, sharedThreadPool: nil, reportHead: reportHead, reportProgress: reportProgress)
8182
}
82-
83+
8384
private init(
8485
path: String,
8586
sharedThreadPool: NIOThreadPool?,
@@ -94,15 +95,14 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
9495
pool = NIOThreadPool(numberOfThreads: 1)
9596
self.threadPool = .owned(pool)
9697
}
97-
98+
9899
pool.start()
99100
self.io = NonBlockingFileIO(threadPool: pool)
100101
self.filePath = path
101102

102103
self.reportHead = reportHead
103104
self.reportProgress = reportProgress
104105
}
105-
106106

107107
public func didReceiveHead(
108108
task: HTTPClient.Task<Response>,
@@ -150,7 +150,7 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
150150
private func close(fileHandle: NIOFileHandle) {
151151
try! fileHandle.close()
152152
self.fileHandleFuture = nil
153-
switch threadPool {
153+
switch self.threadPool {
154154
case .unowned:
155155
break
156156
case .owned(let pool):
@@ -177,7 +177,7 @@ public final class FileDownloadDelegate: HTTPClientResponseDelegate {
177177
self.finalize()
178178
return self.progress
179179
}
180-
180+
181181
deinit {
182182
switch threadPool {
183183
case .unowned:

0 commit comments

Comments
 (0)