Update Rust crate uuid to v1 #7
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/uuid-1.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.8.2
->1.0.0
Release Notes
uuid-rs/uuid
v1.0.0
Compare Source
This release includes a huge amount of work from a lot of contributors. These notes are duplicated from
1.0.0-alpha.1
since they're relevant for anybody moving from0.8.2
to1.0.0
.Changes since the last release
Contributions since the last release
@Gaelan @hecsalazarf @Expyron @saiintbrisson @tshepang @Tehnix @Takashiidobe @A248 @clehner
With a special thanks to:
@kinggoesgaming @QnnOkabayashi @Nugine
Highlights
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:Case |
1.0.0-alpha.1
|0.8.3
----------------------- | ------------------ | ------------------
parse_invalid_character | 40 ns/iter (+/- 0) | 39 ns/iter (+/- 1)
parse_invalid_group_len | 47 ns/iter (+/- 1) | 52 ns/iter (+/- 5)
parse_invalid_groups | 58 ns/iter (+/- 1) | 58 ns/iter (+/- 0)
parse_invalid_len | 57 ns/iter (+/- 2) | 6 ns/iter (+/- 0)
parse_nil | 16 ns/iter (+/- 0) | 50 ns/iter (+/- 4)
parse_nil_hyphenated | 17 ns/iter (+/- 0) | 59 ns/iter (+/- 2)
parse_random | 16 ns/iter (+/- 0) | 42 ns/iter (+/- 1)
parse_random_hyphenated | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 2)
parse_urn | 18 ns/iter (+/- 0) | 51 ns/iter (+/- 1)
You can go one step further and look at the
uuid-simd
library for vectorized UUID parsing. It's fast!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
With
uuid
1.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.Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.