mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Enable implicit_return and fix all violations (#5658)
This commit is contained in:
@@ -23,11 +23,11 @@ public struct SwiftLintSyntaxMap {
|
||||
/// - returns: The array of syntax tokens intersecting with byte range.
|
||||
public func tokens(inByteRange byteRange: ByteRange) -> [SwiftLintSyntaxToken] {
|
||||
func intersect(_ token: SwiftLintSyntaxToken) -> Bool {
|
||||
return token.range.intersects(byteRange)
|
||||
token.range.intersects(byteRange)
|
||||
}
|
||||
|
||||
func intersectsOrAfter(_ token: SwiftLintSyntaxToken) -> Bool {
|
||||
return token.offset + token.length > byteRange.location
|
||||
token.offset + token.length > byteRange.location
|
||||
}
|
||||
|
||||
guard let startIndex = tokens.firstIndexAssumingSorted(where: intersectsOrAfter) else {
|
||||
@@ -49,6 +49,6 @@ public struct SwiftLintSyntaxMap {
|
||||
///
|
||||
/// - returns: The syntax kinds in the specified byte range.
|
||||
public func kinds(inByteRange byteRange: ByteRange) -> [SyntaxKind] {
|
||||
return tokens(inByteRange: byteRange).compactMap { $0.kind }
|
||||
tokens(inByteRange: byteRange).compactMap { $0.kind }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user