3 ms·
Could you change the function to accept the whole struct and make it mutate itself internally without external mutable references?
by bionhoward 2y ago
Could you change the function to accept the whole struct and make it mutate itself internally without external mutable references?
- the__alchemist 2y agoYes. Note that this requires a broader restructure that may make the function unusable in other contexts.
- Someone 2y agoAlso only if it is under your control. If it’s in the OS or a third-party library, you can’t change the API.