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

Migrate to foreign_type! macro

Open kvark opened this issue 6 years ago • 2 comments

See https://docs.rs/foreign-types/0.4.0/foreign_types/ What's not clear to me is how this works with a parent type semantics: current macro in metal-rs supports it and uses it, but I don't see it in the foreign_types crate. cc @sfackler

kvark avatar Sep 06 '19 17:09 kvark

What do you mean by parent type semantics? Upcasting? You'd probably end up making a separate trait and macro that wraps foreign_types!.

sfackler avatar Sep 06 '19 18:09 sfackler

@sfackler I mean this - https://github.com/gfx-rs/metal-rs/blob/1b0c776d889a222bf986cb5adfdb5af3d0bfd9ea/src/lib.rs#L66

On a second look, it's just one impl Deref away from what you have. So we can just add it ourselves.

kvark avatar Sep 06 '19 18:09 kvark