Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: uuid-rs/uuid
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.3.4
Choose a base ref
...
head repository: uuid-rs/uuid
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.4.0
Choose a head ref
  • 15 commits
  • 17 files changed
  • 4 contributors

Commits on Jun 16, 2023

  1. Add unstable borsh support

    grovesNL committed Jun 16, 2023
    Copy the full SHA
    c94dc37 View commit details

Commits on Jun 21, 2023

  1. Copy the full SHA
    9366f01 View commit details
  2. Fixing issue with Cloudflare Workers when using now(): "LinkError: We…

    …bAssembly.Instance(): Import #9 module="./index_bg.js" function="__wbg_now_dc6f7ce2227b5592" error: function import requires a callable"
    
    Similar issue: rustwasm/gloo#249
    kmusick committed Jun 21, 2023
    Copy the full SHA
    b5f16b9 View commit details

Commits on Jun 26, 2023

  1. Merge pull request #688 from kmusick/fix-wasm-tests

    Fixed wasm tests not running due to incorrect attribute target
    KodrAus authored Jun 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bf7fe91 View commit details
  2. Merge pull request #690 from kmusick/fix-cloudflare-workers-timestamp

    Fixing issue with Cloudflare Workers and wasm32-unknown-unknown when using now()
    KodrAus authored Jun 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    934f10c View commit details
  3. Merge pull request #686 from pod2co/borsh

    Add `borsh` support
    KodrAus authored Jun 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    952f75f View commit details
  4. Copy the full SHA
    7da3f69 View commit details

Commits on Jun 27, 2023

  1. Copy the full SHA
    646bd98 View commit details
  2. Copy the full SHA
    759c971 View commit details
  3. add missing wasm test attr

    KodrAus committed Jun 27, 2023
    Copy the full SHA
    8babf97 View commit details
  4. run fmt

    KodrAus committed Jun 27, 2023
    Copy the full SHA
    cb80ba2 View commit details
  5. add missing wasm import

    KodrAus committed Jun 27, 2023
    Copy the full SHA
    0cb9232 View commit details
  6. Merge pull request #691 from uuid-rs/fix/timestamp-gen

    Fix some timestamp generation
    KodrAus authored Jun 27, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb2aac0 View commit details
  7. prepare for 1.4.0 release

    KodrAus committed Jun 27, 2023
    Copy the full SHA
    d9f72db View commit details
  8. Merge pull request #692 from uuid-rs/cargo/1.4.0

    Prepare for 1.4.0 release
    KodrAus authored Jun 27, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0fc3101 View commit details
Showing with 619 additions and 91 deletions.
  1. +1 −1 .github/workflows/ci.yml
  2. +12 −4 Cargo.toml
  3. +3 −3 README.md
  4. +1 −1 macros/Cargo.toml
  5. +2 −0 src/external.rs
  6. +1 −1 src/external/arbitrary_support.rs
  7. +24 −0 src/external/borsh_support.rs
  8. +311 −42 src/lib.rs
  9. +83 −12 src/timestamp.rs
  10. +29 −4 src/v1.rs
  11. +21 −3 src/v3.rs
  12. +21 −3 src/v4.rs
  13. +29 −4 src/v5.rs
  14. +29 −4 src/v6.rs
  15. +38 −6 src/v7.rs
  16. +13 −2 src/v8.rs
  17. +1 −1 tests/smoke-test/src/main.rs
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name: Continuous integration

env:
VERSION_FEATURES: "v1 v3 v4 v5 v6 v7 v8"
DEP_FEATURES: "slog serde arbitrary zerocopy"
DEP_FEATURES: "slog serde arbitrary borsh zerocopy"

on:
pull_request:
16 changes: 12 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -27,13 +27,13 @@ homepage = "https://github.com/uuid-rs/uuid"
name = "uuid"
readme = "README.md"
repository = "https://github.com/uuid-rs/uuid"
version = "1.3.4" # remember to update html_root_url in lib.rs
version = "1.4.0" # remember to update html_root_url in lib.rs

[package.metadata.docs.rs]
rustc-args = ["--cfg", "uuid_unstable"]
rustdoc-args = ["--cfg", "uuid_unstable"]
targets = ["x86_64-unknown-linux-gnu"]
features = ["serde", "arbitrary", "slog", "v1", "v3", "v4", "v5", "v6", "v7", "v8"]
features = ["serde", "arbitrary", "slog", "borsh", "v1", "v3", "v4", "v5", "v6", "v7", "v8"]

[package.metadata.playground]
features = ["serde", "v1", "v3", "v4", "v5", "v6", "v7", "v8"]
@@ -95,6 +95,14 @@ version = "1.1.3"
optional = true
version = "0.6"

# Public (unstable): Used in trait impls on `Uuid`
# Unstable: also need RUSTFLAGS="--cfg uuid_unstable" to work
# This feature may break between releases, or be removed entirely before
# stabilization.
[dependencies.borsh]
optional = true
version = "0.10.3"

# Private
# Don't depend on this optional feature directly: it may change at any time
# use the `rng` feature instead
@@ -134,7 +142,7 @@ version = "1"
# Use the `macro-diagnostics` feature instead
[dependencies.uuid-macro-internal]
package = "uuid-macro-internal"
version = "1.3.4"
version = "1.4.0"
path = "macros"
optional = true

@@ -165,7 +173,7 @@ version = "1.0.56"
package = "wasm-bindgen"
version = "0.2"

[target.'cfg(target = "wasm32-unknown-unknown")'.dev-dependencies.wasm-bindgen-test]
[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown"))'.dev-dependencies.wasm-bindgen-test]
version = "0.3"

[dev-dependencies.trybuild]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ Add the following to your `Cargo.toml`:

```toml
[dependencies.uuid]
version = "1.3.4"
version = "1.4.0"
features = [
"v4", # Lets you generate random UUIDs
"fast-rng", # Use a faster (but still sufficiently random) RNG
@@ -66,7 +66,7 @@ assert_eq!(Some(Version::Random), my_uuid.get_version());
If you'd like to parse UUIDs _really_ fast, check out the [`uuid-simd`](https://github.com/nugine/uuid-simd)
library.

For more details on using `uuid`, [see the library documentation](https://docs.rs/uuid/1.3.4/uuid).
For more details on using `uuid`, [see the library documentation](https://docs.rs/uuid/1.4.0/uuid).

## Minimum Supported Rust Version (MSRV)

@@ -75,7 +75,7 @@ CI. It may be bumped in minor releases as necessary.

## References

* [`uuid` library docs](https://docs.rs/uuid/1.3.4/uuid).
* [`uuid` library docs](https://docs.rs/uuid/1.4.0/uuid).
* [Wikipedia: Universally Unique Identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier).
* [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](http://tools.ietf.org/html/rfc4122).

2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uuid-macro-internal"
version = "1.3.4"
version = "1.4.0"
edition = "2018"
authors = [
"QnnOkabayashi"
2 changes: 2 additions & 0 deletions src/external.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(feature = "arbitrary")]
pub(crate) mod arbitrary_support;
#[cfg(all(uuid_unstable, feature = "borsh"))]
pub(crate) mod borsh_support;
#[cfg(feature = "serde")]
pub(crate) mod serde_support;
#[cfg(feature = "slog")]
2 changes: 1 addition & 1 deletion src/external/arbitrary_support.rs
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ impl Arbitrary<'_> for Uuid {
Ok(Builder::from_random_bytes(b).into_uuid())
}

fn size_hint(depth: usize) -> (usize, Option<usize>) {
fn size_hint(_: usize) -> (usize, Option<usize>) {
(16, Some(16))
}
}
24 changes: 24 additions & 0 deletions src/external/borsh_support.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#[cfg(test)]
mod borsh_tests {
use crate::Uuid;
use borsh::{BorshDeserialize, BorshSerialize};
use std::string::ToString;

#[test]
fn test_serialize() {
let uuid_str = "f9168c5e-ceb2-4faa-b6bf-329bf39fa1e4";
let uuid = Uuid::parse_str(uuid_str).unwrap();
let uuid_bytes = uuid.as_bytes().to_vec();
let borsh_bytes = uuid.try_to_vec().unwrap();
assert_eq!(uuid_bytes, borsh_bytes);
}

#[test]
fn test_deserialize() {
let uuid_str = "f9168c5e-ceb2-4faa-b6bf-329bf39fa1e4";
let uuid = Uuid::parse_str(uuid_str).unwrap();
let uuid_bytes = uuid.as_bytes().to_vec();
let deserialized = Uuid::try_from_slice(&uuid_bytes).unwrap().to_string();
assert_eq!(uuid_str, deserialized);
}
}
Loading