Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new objc class macro #604

Closed
grovesNL opened this issue Jul 16, 2018 · 1 comment
Closed

Use new objc class macro #604

grovesNL opened this issue Jul 16, 2018 · 1 comment

Comments

@grovesNL
Copy link
Contributor

objc added a class macro which caches access to the class. So basically we can simply replace all Class::get("x").unwrap() with class!(x). The unwrap isn't needed anymore because the macro will panic if it fails. Note also that this macro should eventually (through procedural macros) be able to link directly to the class.

I'd be happy to send a PR which performs this replacement, but cases like https://github.com/tomaka/winit/blob/master/src/platform/ios/mod.rs#L173 need to be clarified (do these ever actually fail?).

@francesca64
Copy link
Member

Nah, those never fail, at least in a sane world. I'd be happy to see a PR for this, so thanks in advance.

@grovesNL grovesNL mentioned this issue Jul 17, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants