3 ms·
This is why I like Rust’s associated functions concept. It is just functions and data. But with organization of clear relationships. “These functions act on th
by Waterluvian 3y ago
This is why I like Rust’s associated functions concept. It is just functions and data. But with organization of clear relationships. “These functions act on these data.” (And a bit of syntactic sugar)
- diarrhea 3y agoOne disadvantage here is taking the entire struct on each operation even if only a single part of it is needed. That can be much harder to deal with due to ownership rules (if &Mut self or all of self is taken). Free functions can be easier then.