Why do all examples clone() and move all values into callbacks? #68
Labels
c-question
Further information is requested
p-high
High Priority
x-help wanted
Extra attention is needed
I noticed that all examples
clone()
andmove
all values into the callbacks, including theui
context and all controls. In the case ofinptus.rs
, the mutable application state is wrapped in aRc
(over theRefCell
) to be able toclone()
andmove
several references into the callbacks.I tried removing all of this overhead, just passing around simple read-only references, and everything seems to work the same (on Linux.)
What is the reason for adding those operations to the examples? Could you add a paragraph of documentation to the README explaining this choice?
In case it is needed to avoid problems and/or cross-platform compatibility, could you make it so that forgetting to do it would cause a compilation error? It seems an easy thing to forget, especially since everything seems to be working the same.
The text was updated successfully, but these errors were encountered: