3 ms·
I have been hurt by issues similar to inc(&mut self) in the "Functional abstraction" section so many times. I have been considering using macros as a workaround
by gardaani 4y ago
I have been hurt by issues similar to inc(&mut self) in the "Functional abstraction" section so many times. I have been considering using macros as a workaround, but so far I have just written the same code multiple times. DRY isn't easy in Rust.
- edflsafoiewq 4y agoMe too. You can make the references at the caller and pass them individually to the function, like inc(&mut self.x), but that's also not very nice. It's weird how this is at odds with the purpose of grouping variables into a logical struct in the first place.