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 serde 1.0 support #296

Merged
merged 1 commit into from Apr 30, 2017
Merged

Add serde 1.0 support #296

merged 1 commit into from Apr 30, 2017

Conversation

@mhristache
Copy link
Contributor

mhristache commented Apr 22, 2017

This commit is adding support for serde 1.0 and update docs
to address #282.

Fix #282
Fix #295

Note1: I had to bump the version of url_serde to 0.2 as the changes are not backward compatible and will cause custom derive to fail if the users are using serde 0.9.

Note2: I have decided not to use remote-derive serde feature for now. I will look into it more and maybe to another PR later.


This change is Reviewable

This commit is adding support for serde 1.0 and update docs
to address #282.

Fix #282
Fix #295
Wallacoloo added a commit to Wallacoloo/libfriendship that referenced this pull request Apr 29, 2017
Note: now using a fork from the servo/rust-url repo until
servo/rust-url#296 is merged.
impl Deserialize for De<Url> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer {
impl<'de> Deserialize<'de> for De<Url> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de> {
let string_representation: String = Deserialize::deserialize(deserializer)?;

This comment has been minimized.

@SimonSapin

SimonSapin Apr 30, 2017

Member

With serde 1.0 we might be able to use Cow<'de, str> here instead of String (https://serde.rs/borrow.html) and make one less memory allocation in most cases. But that can be done later.

@SimonSapin
Copy link
Member

SimonSapin commented Apr 30, 2017

Thanks for this PR! Looks good.

As discussed in #295 we’re not quite sure yet how to deal with serde 1.0 in all of Servo’s dependency graph, but that shouldn’t block this. We can always publish other 0.1.x versions of url_serde if necessary.

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Apr 30, 2017

📌 Commit 9078704 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

bors-servo commented Apr 30, 2017

Testing commit 9078704 with merge 01c0932...

bors-servo added a commit that referenced this pull request Apr 30, 2017
Add serde 1.0 support

This commit is adding support for serde 1.0 and update docs
to address #282.

Fix #282
Fix #295

Note1: I had to bump the version of `url_serde` to `0.2` as the changes are not backward compatible and will cause custom derive to fail if the users are using `serde 0.9`.

Note2: I have decided not to use `remote-derive` serde feature for now. I will look into it more and maybe to another PR later.

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

bors-servo commented Apr 30, 2017

☀️ Test successful - status-travis
Approved by: SimonSapin
Pushing 01c0932 to master...

@bors-servo bors-servo merged commit 9078704 into servo:master Apr 30, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@SimonSapin
Copy link
Member

SimonSapin commented Apr 30, 2017

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.