-
Notifications
You must be signed in to change notification settings - Fork 191
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
Prepare for 1.0.0-alpha.1 release #553
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://camo.githubusercontent.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
uuid
1.0
that can be used to ensure everything is good in downstream consumers. Ideally we won't make any API changes before actually stabilizing1.0
proper, 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
Try
no longer being implemented #521uuid!("")
macro diagnostics when usingurn:uuid
prefix. #554try_parse
andencode
performance #562Highlights
Parsing and formatting methods are now much faster, and work in
const
too! On my i9 9900K Windows desktop, the difference looks something like this:1.0.0-alpha.1
0.8.3
You can go one step further and look at the
uuid-simd
library 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-diagnostics
crate feature to get better diagnostics fromuuid!
using a procedural macro.Breaking changes
Relocation of
adapter::compact
This module can now be found in
serde::compact
. It can be combined with#[serde(with)]
to serialize aUuid
using 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_fields
Uuid::from_fields_le
Uuid::new_v1
Builder::from_fields
Builder::from_fields_le
Infallible
get_variant
The
Uuid::get_variant
method now returns aVariant
instead of anOption<Varaint>
, because it's not actually possible for it to ever beNone
.Uuid::to_timestamp
is nowUuid::get_timestamp
The
Uuid::to_timestamp
method has been renamed toUuid::get_timestamp
to make it more consistent withUuid::get_version
andUuid::get_variant
.Changes to formatting methods
The following methods that produce formatting adapters have been renamed:
Uuid::to_hyphenated
->Uuid::hyphenated
Uuid::to_simple
->Uuid::simple
Uuid::to_urn
->Uuid::urn
The following types have been removed:
HyphenatedRef
SimpleRef
UrnRef
The following methods have been changed to return a
&<AdapterType>
instead of an<AtapterType>Ref
:Uuid::to_hyphenated_ref
->Uuid::as_hyphenated
Uuid::to_simple_ref
->Uuid::as_simple
Uuid::to_urn_ref
->Uuid::as_urn
Builder
method consistencyThe
Builder::build
method has been renamed toBuilder::into_uuid
, to complement the<AdapterType>::into_uuid
methods. It also gets an equivalentBuilder::as_uuid
method.Version
andVariant
are non-exhaustiveThe
#[non_exhaustive]
attribute has been added toVersion
andVariant
. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.Removed
winapi
supportThe
Uuid::to_guid
andUuid::from_guid
methods have been removed. This was done for two reasons:winapi
types in the stableuuid
public API.There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.
Building with
--all-features
Now that
uuid
includes 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
uuid
releases1.0
we'll try to stay on that version "forever". There won't be a2.0
unless there's a very compelling need for it. That means you should feel safe depending onUuid
in the public API of your libraries if you want to.