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

Add a prelude #121

Closed
ripytide opened this issue Jul 9, 2024 · 2 comments · Fixed by #122
Closed

Add a prelude #121

ripytide opened this issue Jul 9, 2024 · 2 comments · Fixed by #122

Comments

@ripytide
Copy link
Contributor

ripytide commented Jul 9, 2024

From #64:

Add prelude::*? There's a bunch of traits.

A question here might be what goes into the prelude? Just the traits, or traits and pixels, or everything? If everything then could we get away with rgb::* as all items are exported from the top-level (depending on the errors module being discussed in #118).

@kornelski
Copy link
Owner

kornelski commented Jul 9, 2024

Probably just traits, as otherwise it's too close to rgb::*. My thinking is that importing all traits would help migrate between versions, because you'll get the methods regardless of where they come from.

Another thing is that there's a trade-off between having one trait that contains all the methods (simple to import, easy to browse in docs), vs having many small traits with just the relevant methods. Importing almost a trait per method is burdensome. Wildcard import helps to hide the trait split a bit.

@ripytide
Copy link
Contributor Author

Sounds good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants