Closed cireu closed 2 years ago
If we don't have this, struct contains Animation
cannot use #[derive(Debug)]
Do you think a more abstract implementation like this one would be sufficient for your use case? https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9af39eac8f9e0d0445c25a83470ca3d5
Hmm, Animation { .. }
is OK, but IMO a extra pointer address information is not bad. Could you please tell me your concern on printing the pointer address? Thanks.
From an API perspective, I want no way of anyone to obtain that adress so I don't have to worry about them using it to make the API unsound. For example, an application could extract the adress from the debug string and call the rlottie's destructor, making all further calls to Animation
, including its Drop
impl, unsound.
In short, giving the adress to anyone makes it impossible to uphold safety prerequisites which are necessary for the unsafe
codeblocks used in the crate.
OK :) I'd glad to see your code example above being merged
I just released it in 0.3.1
Why do you need this? I'd assume printing a pointer isn't necessarily helpful for debugging.