-
Notifications
You must be signed in to change notification settings - Fork 189
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
feat: Implement IntoOwned
for more types
#599
Conversation
cc @devongovett |
hmm good question. selectors are annoying. I started by trying to use the existing Seems like we have 4 options:
(3) seems like it would be easy but seemed like you had to do some hacking to get derive to import |
I think 4 would be rather easy if you are fine with a new crate. I agree that a new crate can be too much for this... but I think this crate can be generally useful. |
Actually yeah, moving only IntoOwned to a separate crate is a pretty good idea since it isn't really lightningcss specific. If you want to do that within the repo for now, maybe I can move it to a separate one later on. Not really sure of a good name for it that's available on crates.io... Maybe just Btw, since it's now a trait, I think a bunch of the special cases (e.g. Option and Box) can also be implemented with generics instead of in the derive macro so it might get a lot simpler. |
What about |
I like it! |
I did it 😄 |
Ah. I think the code for derive macro require some cleanup. |
Sure, yeah I can take a look. Thanks so much for working on this. It'll be really helpful for some use cases I have in mind too. I'll look into moving these crates into a separate repo at some point and I can add you as a maintainer there too. |
@devongovett May I ask when a new version will be published? |
Done 938fc8c |
Thank you! |
Whoa, that's cool I'm in a part of a Pull Request. |
I forgot to add
derive
s.But I'm stuck due to an API design issue.
Is it fine to implement
IntoOwned
for the selector types? If so, where should the trait definition go?