mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Motivation: Apparently when I wrote the WebSocket parser I forgot that enums are great, and so I added a bunch of optional properties. That was silly. This patch changes the WSParser structure to use an enum with associated data to ensure that we only store state when we are supposed to, and to guarantee that the state is good. Modifications: Move all state to enum case associated data. Result: Easier to validate the correctness of the WSParser code. Motivation: Explain here the context, and why you're making that change. What is the problem you're trying to solve. Modifications: Describe the modifications you've done. Result: After your change, what will change.