Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrandonw authored and github-actions[bot] committed Jul 18, 2024
1 parent 0a0403b commit a774223
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/CasePathsMacros/CasePathableMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ extension CasePathableMacro: MemberMacro {
"""
]

let hasElementGeneric = enumDecl.genericParameterClause?.parameters
let hasElementGeneric =
enumDecl.genericParameterClause?.parameters
.contains { $0.name.text == "Element" }
?? false
if hasElementGeneric {
Expand Down Expand Up @@ -179,7 +180,8 @@ extension CasePathableMacro: MemberMacro {
) -> [DeclSyntax] {
decl.elements.map {
let caseName = $0.name.trimmed
let associatedValueName = $0.trimmedTypeDescription == "Element"
let associatedValueName =
$0.trimmedTypeDescription == "Element"
? "_$Element"
: $0.trimmedTypeDescription
let hasPayload = $0.parameterClause.map { !$0.parameters.isEmpty } ?? false
Expand Down

0 comments on commit a774223

Please sign in to comment.