-
Notifications
You must be signed in to change notification settings - Fork 221
Prepare for 1.0.0-alpha.1 release #553
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
Conversation
|
Just cross-posting a comment from Reddit on the change to
https://www.reddit.com/r/rust/comments/qksulj/comment/hizps4r/
|
|
How about bumping the edition to 2021 (in a separate PR)? I know there
won't be much changes but I think its better to keep it to the latest
edition.
…On Tue, 2 Nov 2021 11:27 Ashley Mannix, ***@***.***> wrote:
Just cross-posting a comment from Reddit on the change to serde:
For some serialization formats, byte array is more efficient per element
than seq. Tuple is similar to seq, except it has known length. For example,
consider a format where each element has one byte overhead, where tuple
would thus cost 2*16 bytes instead of 1+16 bytes for byte array.
https://www.reddit.com/r/rust/comments/qksulj/comment/hizps4r/
<https://assets-git-camo.f3mw1.com/a4fa7f4594e0a03053290995bcd6501f6f57fdd60ac98a56f2476a296f42ca36/68747470733a2f2f7777772e7265646469747374617469632e636f6d2f6e65772d69636f6e2e706e67>
reddit
*Getting ready for uuid 1.0
<https://www.reddit.com/r/rust/comments/qksulj/comment/hizps4r/>*
I don't understand the serde change. Which type of the serde data model
does a uuid map to now, if not `byte array [u8]`? A `tuple` with 16...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#553 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC6MJNPH3BDKWABTDZIABALUJ64KHANCNFSM5HFIDH3Q>
.
|
|
I think the serde change is not positive. It's untypical, generally serde hasn't been used like this and it's going to break a lot of formats. I'm also not convinced that u128 is a better solution here. Does the length information cause a problem in practice that it's worth considering going out of the way to do something untypical here? |
|
@mitsuhiko I've opened #557 that we can use to try come to some resolution. We won't be shipping any builds with a changed |
|
The change to the default serialization format has been reverted, so |
|
I think we've been through and over the feedback that came in from the community, so the last thing to do is a final pass over the API to make sure nothing's been missed. I've done this myself, but would appreciate any more eyes on it! You can use: to explore the complete public API. |
|
cc @kinggoesgaming how is everything looking to you now? |
|
@KodrAus Following the current activity on repo, this should be good. Will have a look in the morning through the entire codebase just to see if there is anything that was missed out. |
|
@KodrAus I think all is good for the first alpha release. |
|
Thanks for reviewing this @kinggoesgaming! |
Part of #113
This PR gets us ready for an alpha release of
uuid1.0that can be used to ensure everything is good in downstream consumers. Ideally we won't make any API changes before actually stabilizing1.0proper, but some things may come up that need additional breaking alpha releases.This release includes a huge amount of work from a lot of contributors. I'll try call out breakage here as well as in release notes once we're ready to merge so everyone knows what to expect.
Changes since the last release
0.8.2...main
Contributions since the last release
Tryno longer being implemented #521uuid!("")macro diagnostics when usingurn:uuidprefix. #554try_parseandencodeperformance #562Highlights
Parsing and formatting methods are now much faster, and work in
consttoo! On my i9 9900K Windows desktop, the difference looks something like this:1.0.0-alpha.10.8.3You can go one step further and look at the
uuid-simdlibrary for vectorized UUID parsing. It's fast!You've got two options for compile-time UUIDs:
You can create UUIDs at compile time using the
uuid!macro:Enable the
macro-diagnosticscrate feature to get better diagnostics fromuuid!using a procedural macro.Breaking changes
Relocation of
adapter::compactThis module can now be found in
serde::compact. It can be combined with#[serde(with)]to serialize aUuidusing a more compact representation. We originally moved to this representation directly, but discovered it comes with its own drawbacks that aren't suitable for all formats.Infallible constructors
The following methods have been changed to accept a
&[u8; N]instead of a&[u8], making them infallible instead of returning aResult:Uuid::from_fieldsUuid::from_fields_leUuid::new_v1Builder::from_fieldsBuilder::from_fields_leInfallible
get_variantThe
Uuid::get_variantmethod now returns aVariantinstead of anOption<Varaint>, because it's not actually possible for it to ever beNone.Uuid::to_timestampis nowUuid::get_timestampThe
Uuid::to_timestampmethod has been renamed toUuid::get_timestampto make it more consistent withUuid::get_versionandUuid::get_variant.Changes to formatting methods
The following methods that produce formatting adapters have been renamed:
Uuid::to_hyphenated->Uuid::hyphenatedUuid::to_simple->Uuid::simpleUuid::to_urn->Uuid::urnThe following types have been removed:
HyphenatedRefSimpleRefUrnRefThe following methods have been changed to return a
&<AdapterType>instead of an<AtapterType>Ref:Uuid::to_hyphenated_ref->Uuid::as_hyphenatedUuid::to_simple_ref->Uuid::as_simpleUuid::to_urn_ref->Uuid::as_urnBuildermethod consistencyThe
Builder::buildmethod has been renamed toBuilder::into_uuid, to complement the<AdapterType>::into_uuidmethods. It also gets an equivalentBuilder::as_uuidmethod.VersionandVariantare non-exhaustiveThe
#[non_exhaustive]attribute has been added toVersionandVariant. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.Removed
winapisupportThe
Uuid::to_guidandUuid::from_guidmethods have been removed. This was done for two reasons:winapitypes in the stableuuidpublic API.There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.
Building with
--all-featuresNow that
uuidincludes unstable features, if you're building with--all-features(such as in package manager scenarios), you'll also need to passRUSTFLAGS="--cfg uuid_unstable", or you'll end up with compilation errors. If this strategy becomes problematic for users we can change unstable features to silently no-op instead of cause compilation failures if the corresponding cfg is not also supplied. Please reach out if that affects you!Stability commitment
Once
uuidreleases1.0we'll try to stay on that version "forever". There won't be a2.0unless there's a very compelling need for it. That means you should feel safe depending onUuidin the public API of your libraries if you want to.