objc2 icon indicating copy to clipboard operation
objc2 copied to clipboard

Use `impl` instead of ProtocolObject where possible

Open madsmtm opened this issue 9 months ago • 0 comments

Builds upon https://github.com/madsmtm/objc2/pull/516.

We now use &(impl MyProtocol + Message) instead of &ProtocolObject<dyn MyProtocol> as parameters to functions, this allows users to pass in their objects to these functions much more easily.

I'm not sure it's worth the tradeoff in code size though (since now a lot of methods are generic where they don't really have to be), will have to think about.

Alternative to https://github.com/madsmtm/objc2/pull/460 (that one is still strictly cleaner, but probably also not really possible in current Rust (?)).

madsmtm avatar Sep 21 '23 12:09 madsmtm