3 ms·
I suspect the author was talking about defining methods for individual variants of an enum, something like enum Foo { A, B } impl Foo::A { fn method_on_a(&
by dbaupp 11y ago
I suspect the author was talking about defining methods for individual variants of an enum, something like
enum Foo { A, B }
impl Foo::A { fn method_on_a(&self) {} }
- da4c30ff 11y agoThere is an RFC[1] for making enum variants first-class types. [1]: https://github.com/rust-lang/rfcs/pull/1450 https://github.com/rust-lang/rfcs/pull/1450
- llogiq 11y agoExactly. I must admit that my wording was not as understandable as it should have been. I'll see if I can rephrase it to better convey the point.