diff --git a/Examples/bidirectional-event-streams-server-example/Sources/BidirectionalEventStreamsServer/GreetingStream.swift b/Examples/bidirectional-event-streams-server-example/Sources/BidirectionalEventStreamsServer/GreetingStream.swift index 0718ed5b..c7c8cad0 100644 --- a/Examples/bidirectional-event-streams-server-example/Sources/BidirectionalEventStreamsServer/GreetingStream.swift +++ b/Examples/bidirectional-event-streams-server-example/Sources/BidirectionalEventStreamsServer/GreetingStream.swift @@ -51,12 +51,12 @@ actor StreamStorage: Sendable { try Task.checkCancellation() print("Recieved a message \(message)") print("Sending greeting back for \(id)") - switch message.message { - case "connecting": continuation.yield(.init(message: "\(name) connected")) - default: - let greetingText = String(format: message.message, name) - continuation.yield(.init(message: greetingText)) - } + let responseText: String = + switch message.message { + case "connecting": "\(name) connected" + default: String(format: message.message, name) + } + continuation.yield(.init(message: responseText)) } continuation.finish() }