-
Notifications
You must be signed in to change notification settings - Fork 333
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 support for Serde 1.0 #327
Conversation
LGTM; thanks for the comments on the copy/pasted code that could be derived, saved me trying to figure out why derive wasn't used. |
☔ The latest upstream changes (presumably #331) made this pull request unmergeable. Please resolve the merge conflicts. |
I fixed the conflict with #331. |
Looking forward to serde 1.0 support landing |
I find the code in |
@drusellers In the meantime, https://docs.rs/url_serde/0.2.0/url_serde/ supports serde 1.0 today. |
☔ The latest upstream changes (presumably #335) made this pull request unmergeable. Please resolve the merge conflicts. |
Unfortunately, url_serde doesn't work on existing types, e.g. |
@konstin you can use |
I really wanted to do a cool demo in a talk where I fetch http://readrust.net/rust2018/feed.json, first show a nice list of posts, and as a bonus quickly extract the domain to see ho many people are using gist.github.com as their blog. Not having serde 1.0 support basically destroys that bonus feature :( |
@killercup See #327 (comment) above. |
☔ The latest upstream changes (presumably #427) made this pull request unmergeable. Please resolve the merge conflicts. |
@SimonSapin that's why I wrote "I really wanted to do a cool demo" 😉 Adding two crates and using #[serde(with = "url_serde")]
url: Url, is not nearly as cool as just writing |
Sorry that SemVer spaghetti is not cool :) I’m considering doing url 2.0 at some point to fix this and other things, but for Servo to use be able to update it’d first need to update hyper from 0.10 to 0.11, which seems to be blocked on websocket support: servo/servo#18518. But since I’d rather not maintain two branches of url and I seem to be the one doing all that work anyway, url 2.0 will wait. |
Ah, I see. That's indeed a pretty big chunk of spaghetti you have on your plate!
I kinda thought using the serde09 crate would resolve this, but I guess the issues run quite a lot deeper than that.
… Am 21.01.2018 um 21:04 schrieb Simon Sapin ***@***.***>:
Sorry that SemVer spaghetti is not cool :) I’m considering doing url 2.0 at some point to fix this and other things, but for Servo to use be able to update it’d first need to update hyper from 0.10 to 0.11, which seems to be blocked on websocket support: servo/servo#18518.
But since I’d rather not maintain two branches of url and I seem to be the one doing all that work anyway, url 2.0 will wait.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@SimonSapin I rebased and removed the 1.0 impls for Host<S> and HostInternal, because I believe most users are really only looking for Serde impls for url::Url. That one does not require serde_derive because we are serializing the url in string form. |
Any update on this? Is this landable? Did something similar land? |
The 2.0 branch has been opened. Per prior statements, this PR should be closed and instead a PR against that branch filed. I have made an alternative serde 1.0 implementation that's closer to the current implementation: 2.0...est31:serde_1.0 I think that this PR's serialization should be used instead where url's are just serialized as strings. |
☔ The latest upstream changes (presumably #517) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks for the PR, David. The version looks more reasonable than the original. I’m going to close this since I took #512 instead, to be part of url 2.0.0. Hopefully it’ll be easy enough for the ecosystem to migrate, but if not we can consider reviving this PR in the |
Fixes #304, fixes #320.
r? @SimonSapin
This change is