Modify enum in its impl

Why it does not work?

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fdab300c69d3b2f9fe2281fd56d2726a

How to fix it?

*self = Enum::Int(v);

Note the * there.

4 Likes