mupdf-rs icon indicating copy to clipboard operation
mupdf-rs copied to clipboard

Use zerocopy or similar library to replace `into()`s with `transmute!`s?

Open itsjunetime opened this issue 11 months ago • 1 comments

Hi, I've been looking into using this library for a project of mine and, although it's not a dealbreaker, I'm not a fan of some low-cost transformations that are being used right now to transform between FFI types and Rust types (e.g. Quad to fz_quad using Quad's From<fz_quad> impl).

I feel like a lot (if not all) of these transformations could be replaced with zerocopy's transmute (or at least proved to be safe and unlock other zero-cost transformations with zerocopy's traits). I've already implemented this in a few places in this codebase locally and think it could improve things.

Are you open to a PR that does this sort of thing?

itsjunetime avatar Feb 10 '25 20:02 itsjunetime

Pull requests are welcome!

messense avatar Feb 11 '25 02:02 messense