3 ms·
I would say the second one is more intuitive to me, it reads like I have a Tree type and it can be either a Leaf or a Node. The rust example to me isn't immedi
by LandR 7y ago
I would say the second one is more intuitive to me, it reads like I have a Tree type and it can be either a Leaf or a Node.
The rust example to me isn't immediately obvious that it's an either / or situation other than that must be how an enum works (I know enums from other languages)