mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
refactor hasExplicitType a tiny bit
This commit is contained in:
@@ -106,16 +106,11 @@ public struct RedundantDiscardableLetRule: CorrectableRule, ConfigurationProvide
|
||||
}
|
||||
|
||||
private func hasExplicitType(utf16Range: Range<Int>, fileContents: NSString) -> Bool {
|
||||
if utf16Range.upperBound == fileContents.length {
|
||||
guard utf16Range.upperBound != fileContents.length else {
|
||||
return false
|
||||
} else {
|
||||
let nextUTF16Unit = fileContents.substring(with: NSRange(location: utf16Range.upperBound, length: 1))
|
||||
if nextUTF16Unit == ":" {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
let nextUTF16Unit = fileContents.substring(with: NSRange(location: utf16Range.upperBound, length: 1))
|
||||
return nextUTF16Unit == ":"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user