Ver código fonte

Fix two compiler warnings.

Daniel Alm 7 anos atrás
pai
commit
2313a9933f
1 arquivos alterados com 2 adições e 2 exclusões
  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)