Skip to content

Commit f0db4fc

Browse files
authored
Remove extra AttributedStringProtocol.range(of:) overload (#1327)
1 parent 9404caa commit f0db4fc

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Tests/FoundationEssentialsTests/AttributedString/AttributedStringTestSupport.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,3 @@ enum TestError: Error {
153153
case conversionError
154154
case markdownError
155155
}
156-
157-
#if !FOUNDATION_FRAMEWORK
158-
159-
extension AttributedStringProtocol {
160-
func range(of other: String) -> Range<AttributedString.Index>? {
161-
let str = String(characters)
162-
guard let strRange = str.firstRange(of: other) else { return nil }
163-
let start = str.unicodeScalars.distance(from: str.startIndex, to: strRange.lowerBound)
164-
let end = str.unicodeScalars.distance(from: str.startIndex, to: strRange.upperBound)
165-
return unicodeScalars.index(startIndex, offsetBy: start) ..< unicodeScalars.index(startIndex, offsetBy: end)
166-
}
167-
}
168-
169-
#endif // !FOUNDATION_FRAMEWORK

0 commit comments

Comments
 (0)