News for hackers. Stuff that matters.
Re:Using enums to represent state in Rust by sowbug on Friday September 22, 2023 @10:13AM (#37612329)
Yes; they take up the size of the largest variant. If you're concerned about that, you can Box<> the contents, and then each variant is effectively a same-sized pointer to something on the heap (plus some bookkeeping).

There are no comments on this comment yet.