From 80654f3036c7fb61b2a7535870160d708dee1b0a Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Fri, 15 Mar 2024 09:26:28 -0700 Subject: [PATCH] Remove local variables --- .../Macros/StateMachineHashableMacro.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Swift/Sources/StateMachineMacros/Macros/StateMachineHashableMacro.swift b/Swift/Sources/StateMachineMacros/Macros/StateMachineHashableMacro.swift index 55ae977..c5ac5de 100644 --- a/Swift/Sources/StateMachineMacros/Macros/StateMachineHashableMacro.swift +++ b/Swift/Sources/StateMachineMacros/Macros/StateMachineHashableMacro.swift @@ -44,24 +44,21 @@ public struct StateMachineHashableMacro: ExtensionMacro { let associatedValues: String = (1...parameters.count) .map { "value\($0)" } .joined(separator: ", ") - let `case`: String = """ + return """ case let .\(element.name.text)(\(associatedValues)): return (\(associatedValues)) """ - return `case` } else { - let `case`: String = """ + return """ case let .\(element.name.text)(value): return (value) """ - return `case` } } else { - let `case`: String = """ + return """ case .\(element.name.text): return () """ - return `case` } }