Skip to content

Commit 5eeee13

Browse files
authored
Minor SwiftFormat update (#957)
Motivation: SwiftFormat improved at a couple of things. CI now fails as a result. Modifications: Reformat code. Result: CI passes.
1 parent 640b0ef commit 5eeee13

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Examples/Google/SpeechToText/Sources/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ final class ViewController: UIViewController {
5151
}
5252
}
5353

54-
private var audioData: Data = Data()
54+
private var audioData = Data()
5555

5656
private let speechService: SpeechService
5757
private let audioStreamManager: AudioStreamManager
@@ -159,7 +159,7 @@ extension ViewController: StreamDelegate {
159159
self.audioData.append(data)
160160

161161
// 100 ms chunk size
162-
let chunkSize: Int = Int(0.1 * Constants.sampleRate * 2)
162+
let chunkSize = Int(0.1 * Constants.sampleRate * 2)
163163

164164
// When the audio data gets big enough
165165
if self.audioData.count > chunkSize {

Sources/GRPC/GRPCKeepaliveHandlers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ struct PingHandler {
215215
/// Number of active streams
216216
private var activeStreams = 0 {
217217
didSet {
218-
if activeStreams > 0 {
218+
if self.activeStreams > 0 {
219219
self.sentPingsWithoutData = 0
220220
}
221221
}

Sources/GRPC/GRPCTimeout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import NIO
2121
/// Timeouts must be positive and at most 8-digits long.
2222
public struct GRPCTimeout: CustomStringConvertible, Equatable {
2323
/// Creates an infinite timeout. This is a sentinel value which must __not__ be sent to a gRPC service.
24-
public static let infinite: GRPCTimeout = GRPCTimeout(
24+
public static let infinite = GRPCTimeout(
2525
nanoseconds: Int64.max,
2626
wireEncoding: "infinite"
2727
)

Sources/GRPC/ServerCallContexts/ServerCallContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ open class ServerCallContextBase: ServerCallContext {
4545

4646
/// Metadata to return at the end of the RPC. If this is required it should be updated before
4747
/// the `responsePromise` or `statusPromise` is fulfilled.
48-
public var trailingMetadata: HTTPHeaders = HTTPHeaders()
48+
public var trailingMetadata = HTTPHeaders()
4949

5050
public init(eventLoop: EventLoop, request: HTTPRequestHead, logger: Logger) {
5151
self.eventLoop = eventLoop

0 commit comments

Comments
 (0)