Skip to content

Commit 4bf6613

Browse files
committed
Fixes deprecated APIs.
1 parent 3c11cdd commit 4bf6613

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/package-spm.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func buildAllTestsTarget(_ testsPath: String) throws {
156156

157157
print(fileRelativePath)
158158

159-
let classMatches = splitClassesRegularExpression.matches(in: testContent as String, options: [], range: NSRange(location: 0, length: testContent.characters.count))
159+
let classMatches = splitClassesRegularExpression.matches(in: testContent as String, options: [], range: NSRange(location: 0, length: testContent.count))
160160
let matchIndexes = classMatches
161161
.map { $0.range.location }
162162

@@ -166,7 +166,7 @@ func buildAllTestsTarget(_ testsPath: String) throws {
166166
let classNames = classMatches.map { (testContent as NSString).substring(with: $0.rangeAt(1)) as NSString }
167167
#endif
168168

169-
let ranges = zip([0] + matchIndexes, matchIndexes + [testContent.characters.count]).map { NSRange(location: $0, length: $1 - $0) }
169+
let ranges = zip([0] + matchIndexes, matchIndexes + [testContent.count]).map { NSRange(location: $0, length: $1 - $0) }
170170
let classRanges = ranges[1 ..< ranges.count]
171171

172172
let classes = zip(classNames, classRanges.map { (testContent as NSString).substring(with: $0) as NSString })

scripts/validate-headers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ let createdBy = try NSRegularExpression(pattern: "// Created by .* on \\d+/\\d+
7272
let copyrightLine = try NSRegularExpression(pattern: "// Copyright © (\\d+) Krunoslav Zaher. All rights reserved.", options: [])
7373

7474
func validateRegexMatches(regularExpression: NSRegularExpression, content: String) -> ([String], Bool) {
75-
let range = NSRange(location: 0, length: content.characters.count)
75+
let range = NSRange(location: 0, length: content.count)
7676
let matches = regularExpression.matches(in: content, options: [], range: range)
7777

7878
if matches.count == 0 {

0 commit comments

Comments
 (0)