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

Make handle_potential_webgl_error more ergonomic #7358

Closed
jdm opened this issue Aug 25, 2015 · 4 comments
Closed

Make handle_potential_webgl_error more ergonomic #7358

jdm opened this issue Aug 25, 2015 · 4 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Aug 25, 2015

We have a macro called handle_potential_webgl_error which takes a return value as the third argument. In the case where a caller has a void return type, we use it like handle_potential_webgl_error(a, b, ()) which I find ugly. We can extend the macro to have a second variant that only takes two arguments and passes the () argument internally, like http://mxr.mozilla.org/servo/source/components/script/dom/macros.rs#6 .

Code: components/script/dom/webglrenderingcontext.rs

@wilcus
Copy link
Contributor

@wilcus wilcus commented Aug 25, 2015

I take this :).

@jdm
Copy link
Member Author

@jdm jdm commented Aug 25, 2015

Great!

@wilcus
Copy link
Contributor

@wilcus wilcus commented Aug 25, 2015

@jdm When you pass None as the third argument do you not mean it's () ?

@jdm
Copy link
Member Author

@jdm jdm commented Aug 25, 2015

No, None is used for methods that return Option<T>. The () is used for methods that have no return type at all.

bors-servo pushed a commit that referenced this issue Aug 26, 2015
Make handle_potential_webgl_error more ergonomic

#7358

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7360)
<!-- Reviewable:end -->
@jdm jdm closed this Sep 14, 2015
jrmuizel pushed a commit to jrmuizel/gecko-cinnabar that referenced this issue Jun 12, 2017
… (from wilcus:ErgonomicSignature); r=Ms2ger

servo/servo#7358

Source-Repo: https://github.com/servo/servo
Source-Revision: 06ba2167ba3a247c1e7473a208ee4e692f6fa30e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Sep 30, 2019
… (from wilcus:ErgonomicSignature); r=Ms2ger

servo/servo#7358

Source-Repo: https://github.com/servo/servo
Source-Revision: 06ba2167ba3a247c1e7473a208ee4e692f6fa30e

UltraBlame original commit: c642331bfee978a4293a714f752e789e86303af6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
… (from wilcus:ErgonomicSignature); r=Ms2ger

servo/servo#7358

Source-Repo: https://github.com/servo/servo
Source-Revision: 06ba2167ba3a247c1e7473a208ee4e692f6fa30e

UltraBlame original commit: c642331bfee978a4293a714f752e789e86303af6
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
… (from wilcus:ErgonomicSignature); r=Ms2ger

servo/servo#7358

Source-Repo: https://github.com/servo/servo
Source-Revision: 06ba2167ba3a247c1e7473a208ee4e692f6fa30e

UltraBlame original commit: c642331bfee978a4293a714f752e789e86303af6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.