瀏覽代碼

Clean up gRPC.swift (#386)

Michael Rebello 6 年之前
父節點
當前提交
ee0f374de3
共有 1 個文件被更改,包括 7 次插入12 次删除
  1. 7 12
      Sources/SwiftGRPC/Core/gRPC.swift

+ 7 - 12
Sources/SwiftGRPC/Core/gRPC.swift

@@ -14,35 +14,30 @@
  * limitations under the License.
  * limitations under the License.
  */
  */
 #if SWIFT_PACKAGE
 #if SWIFT_PACKAGE
-  import CgRPC
+import CgRPC
 #endif
 #endif
-import Foundation // for String.Encoding
 
 
 public final class gRPC {
 public final class gRPC {
   private init() { }  // Static members only.
   private init() { }  // Static members only.
-  
+
   /// Initializes gRPC system
   /// Initializes gRPC system
   public static func initialize() {
   public static func initialize() {
     grpc_init()
     grpc_init()
   }
   }
-  
+
   /// Shuts down gRPC system
   /// Shuts down gRPC system
   public static func shutdown() {
   public static func shutdown() {
     grpc_shutdown()
     grpc_shutdown()
   }
   }
-  
+
   /// Returns version of underlying gRPC library
   /// Returns version of underlying gRPC library
-  ///
-  /// Returns: gRPC version string
   public static var version: String {
   public static var version: String {
     // These two should always be valid UTF-8 strings, so we can forcibly unwrap them.
     // These two should always be valid UTF-8 strings, so we can forcibly unwrap them.
-    return String(cString: grpc_version_string(), encoding: String.Encoding.utf8)!
+    return String(cString: grpc_version_string(), encoding: .utf8)!
   }
   }
-  
+
   /// Returns name associated with gRPC version
   /// Returns name associated with gRPC version
-  ///
-  /// Returns: gRPC version name
   public static var gStandsFor: String {
   public static var gStandsFor: String {
-    return String(cString: grpc_g_stands_for(), encoding: String.Encoding.utf8)!
+    return String(cString: grpc_g_stands_for(), encoding: .utf8)!
   }
   }
 }
 }