-
Notifications
You must be signed in to change notification settings - Fork 49
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
Remove unsafe from some vision framework functions #675
Conversation
Thanks a lot!
Sorry, that was outdated, exceptions have been safe since #669. I've removed the note in 5048147.
Yeah, the underscore is wrong in this context, it should just be the selector (so |
Thanks, added VNImageRequestHandler::perform as a safe function as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Could you rebase (both this PR and the objc2-generated
branch)? Then I'll merge it after
1b28240
to
fc20ae2
Compare
Rebased (objc2-generated didn't need rebasing since there haven't been any changes there recently) |
Sorry, I should've said "squash", my bad 🙄 |
fc20ae2
to
e4ff0eb
Compare
Ah, whoops. Squashed now |
Thanks! |
This is far from comprehensive but is all of the functions that I am currently using from vision framework.
I tried following the guide in the README - none of these functions have any meaningful limitations on their parameters.
The only point that I am unsure of is the last one:
I would really like to add the function
VNImageRequestHandler::performRequests_error
as a safe function as well. It can throw an exception if it gets invalid parameters, but the rust function returns aResult<(), Retained<NSError>>
so I'm not sure why it should be considered unsafe.Either way - I couldn't get header-translator to generate a version of the function marked safe - tried with
class.VNImageRequestHandler.methods."performRequests:error:_".unsafe = false
but it didn't work (possibly due to the underscore)