Skip to content

Commit f6b5624

Browse files
committed
Removes deprecated APIs from Swift preprocessor.
1 parent 798a8f8 commit f6b5624

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Preprocessor/Preprocessor/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func processFile(path: String, outputPath: String) -> String {
4747
let suffix = codePlusSuffixSeparated[1]
4848

4949
if code.hasPrefix("=") {
50-
functionContentComponents.append("components.append(String(\(code.substring(from: code.index(after: code.startIndex)))))\n")
50+
functionContentComponents.append("components.append(String(\(String(code[code.index(after: code.startIndex) ..< code.endIndex]))))\n")
5151
}
5252
else {
5353
functionContentComponents.append("\(code)\n")
@@ -90,7 +90,7 @@ for file in files {
9090

9191
let path = (sourceFilesRoot as NSString).appendingPathComponent(file as String)
9292
let endIndex = path.index(before: path.index(before: path.index(before: path.endIndex)))
93-
let outputPath = path.substring(to: endIndex) + ".swift"
93+
let outputPath = String(path[path.startIndex ..< endIndex]) + ".swift"
9494

9595
generateAllFiles.append("_ = { () -> Void in\n\(processFile(path: path, outputPath: outputPath))\n}()\n")
9696
}

0 commit comments

Comments
 (0)