Browse Source

Minor SwiftFormat update (#957)

Motivation:

SwiftFormat improved at a couple of things. CI now fails as a result.

Modifications:

Reformat code.

Result:

CI passes.
George Barnett 5 years ago
parent
commit
5eeee138ba

+ 2 - 2
Examples/Google/SpeechToText/Sources/ViewController.swift

@@ -51,7 +51,7 @@ final class ViewController: UIViewController {
     }
   }
 
-  private var audioData: Data = Data()
+  private var audioData = Data()
 
   private let speechService: SpeechService
   private let audioStreamManager: AudioStreamManager
@@ -159,7 +159,7 @@ extension ViewController: StreamDelegate {
     self.audioData.append(data)
 
     // 100 ms chunk size
-    let chunkSize: Int = Int(0.1 * Constants.sampleRate * 2)
+    let chunkSize = Int(0.1 * Constants.sampleRate * 2)
 
     // When the audio data gets big enough
     if self.audioData.count > chunkSize {

+ 1 - 1
Sources/GRPC/GRPCKeepaliveHandlers.swift

@@ -215,7 +215,7 @@ struct PingHandler {
   /// Number of active streams
   private var activeStreams = 0 {
     didSet {
-      if activeStreams > 0 {
+      if self.activeStreams > 0 {
         self.sentPingsWithoutData = 0
       }
     }

+ 1 - 1
Sources/GRPC/GRPCTimeout.swift

@@ -21,7 +21,7 @@ import NIO
 /// Timeouts must be positive and at most 8-digits long.
 public struct GRPCTimeout: CustomStringConvertible, Equatable {
   /// Creates an infinite timeout. This is a sentinel value which must __not__ be sent to a gRPC service.
-  public static let infinite: GRPCTimeout = GRPCTimeout(
+  public static let infinite = GRPCTimeout(
     nanoseconds: Int64.max,
     wireEncoding: "infinite"
   )

+ 1 - 1
Sources/GRPC/ServerCallContexts/ServerCallContext.swift

@@ -45,7 +45,7 @@ open class ServerCallContextBase: ServerCallContext {
 
   /// Metadata to return at the end of the RPC. If this is required it should be updated before
   /// the `responsePromise` or `statusPromise` is fulfilled.
-  public var trailingMetadata: HTTPHeaders = HTTPHeaders()
+  public var trailingMetadata = HTTPHeaders()
 
   public init(eventLoop: EventLoop, request: HTTPRequestHead, logger: Logger) {
     self.eventLoop = eventLoop