mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Remove explicit Range initializers
these don't compile with Swift trunk and don't appear to be necessary.
This commit is contained in:
@@ -99,7 +99,7 @@ private extension String {
|
||||
let finalIndex = index(range.upperBound, offsetBy: 1, limitedBy: endIndex),
|
||||
self[range.upperBound] == "?" else { return nil }
|
||||
|
||||
return Range(range.lowerBound..<finalIndex)
|
||||
return range.lowerBound..<finalIndex
|
||||
}
|
||||
|
||||
let angleBrackets = balancedRanges(from: "<", to: ">").compactMap { range -> Range<String.Index>? in
|
||||
@@ -110,7 +110,7 @@ private extension String {
|
||||
self[initialIndex..<range.lowerBound] == "Set",
|
||||
self[range.upperBound] == "?" else { return nil }
|
||||
|
||||
return Range(initialIndex..<finalIndex)
|
||||
return initialIndex..<finalIndex
|
||||
}
|
||||
|
||||
return squareBrackets + angleBrackets
|
||||
@@ -160,7 +160,7 @@ private extension String {
|
||||
if pairCount == 0 && foundCharacter { break }
|
||||
}
|
||||
|
||||
return pairCount == 0 && foundCharacter ? Range(prefixIndex..<currentIndex) : nil
|
||||
return pairCount == 0 && foundCharacter ? prefixIndex..<currentIndex : nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user