Closed gw3583 closed 5 months ago
Great fix thanks :) I think it makes sense to apply this to all samples, and that way we are at least safe from the deprecation warning becoming an error at some point.
Eventually I'd like to get rid of the unsafe
in the samples entirely, maybe by adding some sort of "SokolApp" wrapper/trait/superclass thingie which somehow would provide a "safe-wrapper" for this unsafe user data handling (internally it would probably do the same thing as your fix).
My Rust-foo isn't good enough to know what a proper idiomatic Rust solution would look like though.
Here you go, examples and readme updated. The basic idea of a wrapper with a trait sounds good as a future solution.
Giving this a whirl now...
...and merged. Many thanks, it's nice to see a warning-free build again :)
This only updates the
cube
example to avoid a global static. If you're generally happy with this change, I can update the other examples to be similar.