Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored and github-actions[bot] committed Jun 6, 2024
1 parent 59f98d2 commit f5de96e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/CasePathsMacros/CasePathableMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ extension CasePathableMacro: MemberMacro {
let rootSwitchCases = generateCases(from: memberBlock.members, enumName: enumName) {
"case .\($0.name): return \\.\($0.name)"
}
let rootSwitch: DeclSyntax = rootSwitchCases.isEmpty
let rootSwitch: DeclSyntax =
rootSwitchCases.isEmpty
? "\\.never"
: """
switch root {
\(raw: rootSwitchCases.map(\.description).joined(separator: "\n"))
}
"""
switch root {
\(raw: rootSwitchCases.map(\.description).joined(separator: "\n"))
}
"""
let casePaths = generateDeclSyntax(from: memberBlock.members, enumName: enumName)
let allCases = generateCases(from: memberBlock.members, enumName: enumName) {
"allCasePaths.append(\\.\($0.name))"
Expand Down

0 comments on commit f5de96e

Please sign in to comment.