Skip to content

Commit 29e81ce

Browse files
committed
Refactor startsWithNewline() function to be a computed property
1 parent 3d3f31f commit 29e81ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftSyntaxMacroExpansion/MacroSystem.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ private class AttributeRemover: SyntaxRewriter {
434434
// Ensure that any horizontal whitespace trailing the attributes list is trimmed if the next
435435
// token starts a new line.
436436
if let nextToken = node.nextToken(viewMode: .sourceAccurate),
437-
nextToken.leadingTrivia.startsWithNewline()
437+
nextToken.leadingTrivia.startsWithNewline
438438
{
439439
if !triviaToAttachToNextToken.isEmpty {
440440
triviaToAttachToNextToken = triviaToAttachToNextToken.trimmingSuffix(while: \.isSpaceOrTab)
@@ -490,7 +490,7 @@ private extension Trivia {
490490
)
491491
}
492492

493-
func startsWithNewline() -> Bool {
493+
var startsWithNewline: Bool {
494494
self.first?.isNewline ?? false
495495
}
496496
}

0 commit comments

Comments
 (0)