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

Remove types.rs #958

Closed
nox opened this issue Mar 5, 2017 · 1 comment
Closed

Remove types.rs #958

nox opened this issue Mar 5, 2017 · 1 comment

Comments

@nox
Copy link
Member

@nox nox commented Mar 5, 2017

This was needed only for serde_codegen support. Now that this is gone, we can remove types.rs and move back each type from it to the module where each of them truly belongs.

bors-servo added a commit that referenced this issue Mar 7, 2017
Remove types.rs and move its types into the relevant files.

Addresses issue #958.

The rules followed to decide in where to move each type were roughly:
- Above all, types and their impls should be in the same file.
- If a "well defined category" of types and their impls represents more than a 100 lines of code, move it into its own file (example: font.rs and image.rs).
- If something is only used in one file it goes there (for example a lot of the code that moved into api.rs).
- On the other hand if it is not immediately obvious where a type should be (and it's more than a few lines), move it in its own file (like color.rs).
- display_item.rs contains display item types while display_list.rs contains code to build and serialize display lists. both files being rather big, keep them separate.
- Since all types were exported in webrender_traits' global namespace, all relevant modules ```pub use foo::*;``` there types in as well. If we want to change that, let's do it as a followup since it would add a lot code churn outside of webrender_traits.

The resulting organization is, I think, a lot less surprising. Let me know what you think.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/963)
<!-- Reviewable:end -->
@nical
Copy link
Collaborator

@nical nical commented Mar 7, 2017

This can be closed.

@KiChjang KiChjang closed this Mar 7, 2017
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
3 participants
You can’t perform that action at this time.