Explorar o código

Fix two compiler warnings.

Daniel Alm %!s(int64=7) %!d(string=hai) anos
pai
achega
2313a9933f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Sources/protoc-gen-swiftgrpc/options.swift

+ 2 - 2
Sources/protoc-gen-swiftgrpc/options.swift

@@ -99,9 +99,9 @@ class GeneratorOptions {
       }
 
       // Creates key/value pair and trims whitespace
-      let key = string.substring(to: index)
+      let key = string[..<index]
         .trimmingCharacters(in: .whitespacesAndNewlines)
-      let value = string.substring(from: string.index(after: index))
+      let value = string[string.index(after: index)...]
         .trimmingCharacters(in: .whitespacesAndNewlines)
 
       return (key: key, value: value)