Skip to content

Add serde support and bump version to 0.3.0#31

Merged
bors-servo merged 1 commit intoservo:masterfrom
behnam:serde
May 16, 2017
Merged

Add serde support and bump version to 0.3.0#31
bors-servo merged 1 commit intoservo:masterfrom
behnam:serde

Conversation

@behnam
Copy link
Contributor

@behnam behnam commented May 16, 2017

Add with_serde feature, which implements serde for the new struct Level, mainly used in servo, supporting serde 0.8, 0.9 and 1.0.

Add tests for the with_serde feature. The serde_tests modules only
works for serde:>=1.0, though.

servo has dependency on the loose implementation of visual_runs(),
which couldn not be improved without breaking the API, as it needs more
information to process the levels correctly, and the call-site in
servo does not have all the information needed and needs a non-trivial
change to work with the new improved version. Therefore, I have moved the
old version to a deprecated module, to be used for now until servo
is fixed and we drop the old implementation.

Bump version to 0.3.0, as we now ready for a release: can build
servo (patch ready) and idna crates.


This change is Reviewable

Copy link
Contributor

@mbrubeck mbrubeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Just some minor comments:

Cargo.toml Outdated
matches = "0.1"
serde = {version = ">=0.8", optional = true}
serde_test = {version = ">=0.8", optional = true}
serde_derive = {version = ">=0.8", optional = true}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make these dependencies `">=0.8, <2.0".

/// Find the level runs within a line and return them in visual order.
///
/// NOTE: This implementation is incomplete. The algorithm needs information about the text,
/// including original BidiClass property of each character, to be able to perfor correctly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/perfor/perform/

src/level.rs Outdated
pub struct Level(u8);

#[cfg(feature = "with_serde")]
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could #[cfg_attr(feature = "with_serde", derive(Serialize, Deserialize))] work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely! Thanks!

Add `with_serde` feature, which implements serde for the new `struct
Level`, mainly used in `servo`, supporting serde `0.8`, `0.9` and `1.0`.

Add tests for the `with_serde` feature.  The `serde_tests` modules only
works for `serde:>=1.0`, though.

`servo` has dependency on the loose implementation of `visual_runs()`,
which couldn not be improved without breaking the API, as it needs more
information to process the levels correctly, and the call-site in
`servo` does not have all the information needed and needs a non-trivial
change to work with the new improved version. Therefore, I have moved the
old version to a `deprecated` module, to be used for now until `servo`
is fixed and we drop the old implementation.

Bump version to `0.3.0`, as we now ready for a release: can build
`servo` (patch ready) and `idna` crates.
@behnam
Copy link
Contributor Author

behnam commented May 16, 2017

Okay, addressed all the comments, plus merging a couple of consequent cfg() calls together.

@behnam
Copy link
Contributor Author

behnam commented May 16, 2017

Review status: 0 of 4 files reviewed at latest revision, 3 unresolved discussions.


Cargo.toml, line 20 at r1 (raw file):

Previously, mbrubeck (Matt Brubeck) wrote…

Please make these dependencies `">=0.8, <2.0".

Done.


src/deprecated.rs, line 17 at r1 (raw file):

Previously, mbrubeck (Matt Brubeck) wrote…

s/perfor/perform/

Done.


Comments from Reviewable

@mbrubeck
Copy link
Contributor

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit efa3b2a has been approved by mbrubeck

@bors-servo
Copy link
Contributor

⌛ Testing commit efa3b2a with merge 011d7cf...

bors-servo pushed a commit that referenced this pull request May 16, 2017
Add serde support and bump version to 0.3.0

Add `with_serde` feature, which implements serde for the new `struct
Level`, mainly used in `servo`, supporting serde `0.8`, `0.9` and `1.0`.

Add tests for the `with_serde` feature.  The `serde_tests` modules only
works for `serde:>=1.0`, though.

`servo` has dependency on the loose implementation of `visual_runs()`,
which couldn not be improved without breaking the API, as it needs more
information to process the levels correctly, and the call-site in
`servo` does not have all the information needed and needs a non-trivial
change to work with the new improved version. Therefore, I have moved the
old version to a `deprecated` module, to be used for now until `servo`
is fixed and we drop the old implementation.

Bump version to `0.3.0`, as we now ready for a release: can build
`servo` (patch ready) and `idna` crates.

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

☀️ Test successful - status-travis
Approved by: mbrubeck
Pushing 011d7cf to master...

@bors-servo bors-servo merged commit efa3b2a into servo:master May 16, 2017
@behnam behnam deleted the serde branch May 16, 2017 20:05
@behnam
Copy link
Contributor Author

behnam commented May 17, 2017

@mbrubeck, how these packages get posted on crates.io? Looks like it's manual. Could you please publish 0.2.6 and 0.3.0? Also, we need to tag the commits in git.

Also, are there any projects automating this: releasing on crates.io from travis based on git tags?

@mbrubeck
Copy link
Contributor

Tagged and published. @behnam, would you like to be added as a contributor/owner of this package so that you can publish new versions yourself?

@behnam
Copy link
Contributor Author

behnam commented May 17, 2017

Thanks, @mbrubeck. Well, why not! Would makes things easier for both of us! :)

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 this pull request may close these issues.

3 participants