|
|
|
|
|
by wh33zle
672 days ago
|
|
I find myself defining my own traits very rarely these days. Traits enable polymorphic actions on data. Most of the time, you simply don't need that. An enum often suffices to express the different combinations. Of course, from a pattern perspective, that is "not extensible" but it often ends up being easier to maintain and in Rust, often compiles down to more efficient code. |
|