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

Replace `fallible` boolean arguments with an enum #26047

Closed
jdm opened this issue Mar 27, 2020 · 11 comments
Closed

Replace `fallible` boolean arguments with an enum #26047

jdm opened this issue Mar 27, 2020 · 11 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 27, 2020

Various methods in WebGL objects have fallible arguments that are used to support operations that can fail during object destruction that do not indicate a total failure. We should replace these booleans with a enum Operation { Fallible, Infallible } instead to make the code readable:

Code:

@highfive
Copy link

@highfive highfive commented Mar 27, 2020

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@jdm jdm mentioned this issue Mar 27, 2020
4 of 4 tasks complete
@skrzyp1
Copy link
Contributor

@skrzyp1 skrzyp1 commented Mar 27, 2020

@highfive: assign me
I'll try to do it as i seems beginner friendly.

@highfive highfive added the C-assigned label Mar 27, 2020
@highfive
Copy link

@highfive highfive commented Mar 27, 2020

Hey @skrzyp1! Thanks for your interest in working on this issue. It's now assigned to you!

@akshay1992kalbhor
Copy link

@akshay1992kalbhor akshay1992kalbhor commented Apr 17, 2020

Where would the enum be defined? Its being used my multiple WebGL objects. Also do we need a new name for the second argument now that its an enum? Something like 'operation_fallibility' instead of 'fallible'?

@jdm jdm removed the C-assigned label Apr 17, 2020
@jdm
Copy link
Member Author

@jdm jdm commented Apr 17, 2020

Defining the enum in webglrenderingcontext.rs is probably fine; I think all of those files already import things from that module. Renaming it like you suggest sounds fine.

@skrzyp1
Copy link
Contributor

@skrzyp1 skrzyp1 commented Apr 17, 2020

Sorry i forgot about that ill get to work unless its already WiP by someone else

@akshay1992kalbhor
Copy link

@akshay1992kalbhor akshay1992kalbhor commented Apr 18, 2020

I haven't started working on the issue yet. Just wanted to know how to solve it. I know it was assigned to you so if you still want to work on it go ahead! Sorry for the confusion.

@he4d
Copy link
Contributor

@he4d he4d commented Apr 23, 2020

@highfive: assign me
I will try this

@highfive highfive added the C-assigned label Apr 23, 2020
@highfive
Copy link

@highfive highfive commented Apr 23, 2020

Hey @he4d! Thanks for your interest in working on this issue. It's now assigned to you!

@he4d
Copy link
Contributor

@he4d he4d commented Apr 23, 2020

Do I need to write some tests for this?

@jdm
Copy link
Member Author

@jdm jdm commented Apr 23, 2020

No - if it builds, that's good enough for a PR.

@he4d he4d mentioned this issue Apr 23, 2020
4 of 5 tasks complete
bors-servo added a commit that referenced this issue Apr 23, 2020
Replaced failible boolean with an enum

<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26047 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this issue Apr 24, 2020
Replaced failible boolean with an enum

<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26047 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this issue Apr 24, 2020
Replaced failible boolean with an enum

<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26047 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
bors-servo added a commit that referenced this issue Apr 24, 2020
Replaced failible boolean with an enum

<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #26047 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
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.

5 participants
You can’t perform that action at this time.