2 ms·
You can solve duplication with macros to implement traits. The Rust way seems to provide the same convenience without the runtime costs.
by Gigachad 4y ago
You can solve duplication with macros to implement traits. The Rust way seems to provide the same convenience without the runtime costs.
- seanalltogether 4y agoMacros provide code injection, that's not the same thing. Inheritance allows for overrides so you can have [default super logic]+[custom child logic]. That's only possible in rust with a lot of copy and paste, which can be fragile to maintain long term. Most UI frameworks are built around inheritance to guarantee logic provided by the base view or view group, while allowing for inheritors to mix in custom logic as well