-
Notifications
You must be signed in to change notification settings - Fork 377
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 Sealed trait pattern #354
Conversation
I like it, I skimmed over it and it looks like a good addition to this repository. Maybe others, e.g. @neithernut and/or @pickfire can give it a read as well to leave some always valued feedback. So we can merge it next week. |
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.
LGTM, but I feel it could be extended a bit more:
- Sealed traits in rust are rather nieche, you don't usually use them. Well, unless you do. Imo this is one of those more "advanced" topics.
- The example used (
OsStrExt
) may already be viewed as something of a special case, as it exists multiple types for different configurations with required methods that may or may not diverge from each other:unix
andWASI
are, on the surface, equivalent;windows
, as always, differs. You do list those declarations, but imo that may just confuse some readers. - At the same time that very example also hints at an additional motivation for sealed traits: ensuring comparability not only between versions (if you are not capable or willing to come up with a stable interface) but also between multiple configurations.
@rbran Could you please rebase on |
No description provided.