Skip to content

Commit 755012b

Browse files
committed
run SwiftFormat
1 parent 7a71e83 commit 755012b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Examples/GetJSON/GetJSON.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
// TODO: remove @testable after async/await API is public
1616
@testable import AsyncHTTPClient
17-
import NIOCore
1817
import Foundation
18+
import NIOCore
1919
import NIOFoundationCompat
2020

2121
#if compiler(>=5.5.2) && canImport(_Concurrency)

Examples/Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ let package = Package(
2424
],
2525
dependencies: [
2626
.package(url: "https://github.com/apple/swift-nio.git", .branch("main")),
27-
27+
2828
// in real-world projects this would be
2929
// .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.9.0")
3030
.package(name: "async-http-client", path: "../"),
3131
],
3232
targets: [
3333
// MARK: - Examples
34+
3435
.executableTarget(
3536
name: "GetHTML",
3637
dependencies: [

Examples/StreamingByteCounter/StreamingByteCounter.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ struct StreamingByteCounter {
2727
let request = HTTPClientRequest(url: "https://apple.com")
2828
let response = try await httpClient.execute(request, timeout: .seconds(30))
2929
print("HTTP head", response)
30-
30+
3131
// if defined, the content-length headers announces the size of the body
3232
let expectedBytes = response.headers.first(name: "content-length").flatMap(Int.init)
33-
33+
3434
var receivedBytes = 0
3535
// asynchronously iterates over all body fragments
3636
// this loop will automatically propagate backpressure correctly
3737
for try await buffer in response.body {
3838
// For this example, we are just interested in the size of the fragment
3939
receivedBytes += buffer.readableBytes
40-
40+
4141
if let expectedBytes = expectedBytes {
4242
// if the body size is known, we calculate a progress indicator
43-
let progress = Double(receivedBytes)/Double(expectedBytes)
43+
let progress = Double(receivedBytes) / Double(expectedBytes)
4444
print("progress: \(Int(progress * 100))%")
4545
}
4646
// in case backpressure is needed, all reads will be paused until returned future is resolved

0 commit comments

Comments
 (0)