rust-skia / rust-skia

Rust Bindings for the Skia Graphics Library
MIT License
1.46k stars 133 forks source link

impl PartialEq for RefHandle<N> #607

Closed ennis closed 2 years ago

ennis commented 2 years ago

Is there a reason why PartialEq is not implemented for RefHandle<N> where N: NativePartialEq? There are similar impls for Handle<N> and RCHandle<N>.

I ended up running into an error while trying to compare two sk::textlayout::ParagraphStyle. It seems that NativePartialEq is implemented: https://github.com/rust-skia/rust-skia/blob/661fd60d9466a07cb90aa19a5eac91eaa1dd08cd/skia-safe/src/modules/paragraph/paragraph_style.rs#L166-L170

but the RefHandle wrapper doesn't implement PartialEq in turn. As a workaround, I'd have liked to call the unsafe bindings directly, but that doesn't seem to be possible.

pragmatrix commented 2 years ago

Thanks for reporting this. Obviously an oversight, RefHandle arrived late to the Handle party.