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.2.2
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.3.0
Choose a head ref
  • 12 commits
  • 9 files changed
  • 5 contributors

Commits on Jan 23, 2023

  1. Update windows-sys requirement from 0.42.0 to 0.45.0

    Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
    - [Release notes](https://github.com/microsoft/windows-rs/releases)
    - [Commits](microsoft/windows-rs@0.42.0...0.45.0)
    
    ---
    updated-dependencies:
    - dependency-name: windows-sys
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jan 23, 2023
    Copy the full SHA
    4a08821 View commit details

Commits on Jan 24, 2023

  1. Fix error message.

    Fixes: #655
    basbossink-ds committed Jan 24, 2023
    Copy the full SHA
    3fa4475 View commit details
  2. Copy the full SHA
    40d8711 View commit details

Commits on Jan 28, 2023

  1. implement Arbitrary::size_hint

    This makes generating from non-arbitrary crates work much better, as
    they know how many bytes are needed to arbitrary-generate an uuid.
    Ekleog committed Jan 28, 2023
    Copy the full SHA
    212b902 View commit details

Commits on Jan 31, 2023

  1. Copy the full SHA
    b362542 View commit details
  2. Merge pull request #657 from Ekleog/arbitrary-size-hint

    implement Arbitrary::size_hint
    KodrAus authored Jan 31, 2023
    Copy the full SHA
    52197cd View commit details
  3. Copy the full SHA
    e7eaf5b View commit details

Commits on Feb 1, 2023

  1. Copy the full SHA
    1af8269 View commit details
  2. Merge pull request #658 from uuid-rs/fix/alternate-format

    Always use hyphenated format regardless of flags
    KodrAus authored Feb 1, 2023
    Copy the full SHA
    b90b820 View commit details
  3. Merge pull request #654 from uuid-rs/dependabot/cargo/windows-sys-0.45.0

    Update windows-sys requirement from 0.42.0 to 0.45.0
    KodrAus authored Feb 1, 2023
    Copy the full SHA
    e010787 View commit details
  4. prepare for 1.3.0 release

    KodrAus committed Feb 1, 2023
    Copy the full SHA
    59ac047 View commit details
  5. Merge pull request #659 from uuid-rs/cargo/1.3.0

    Prepare for 1.3.0 release
    KodrAus authored Feb 1, 2023
    Copy the full SHA
    5733626 View commit details
Showing with 22 additions and 26 deletions.
  1. +3 −3 Cargo.toml
  2. +3 −3 README.md
  3. +1 −1 macros/Cargo.toml
  4. +1 −1 src/error.rs
  5. +4 −0 src/external/arbitrary_support.rs
  6. +1 −1 src/external/serde_support.rs
  7. +2 −10 src/fmt.rs
  8. +6 −6 src/lib.rs
  9. +1 −1 src/macros.rs
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ homepage = "https://github.com/uuid-rs/uuid"
name = "uuid"
readme = "README.md"
repository = "https://github.com/uuid-rs/uuid"
version = "1.2.2" # remember to update html_root_url in lib.rs
version = "1.3.0" # remember to update html_root_url in lib.rs

[package.metadata.docs.rs]
rustc-args = ["--cfg", "uuid_unstable"]
@@ -134,7 +134,7 @@ version = "1"
# Use the `macro-diagnostics` feature instead
[dependencies.uuid-macro-internal]
package = "uuid-macro-internal"
version = "1.2.2"
version = "1.3.0"
path = "macros"
optional = true

@@ -175,7 +175,7 @@ version = "1.0.52"
version = "1"

[target.'cfg(windows)'.dev-dependencies.windows-sys]
version = "0.42.0"
version = "0.45.0"
features = ["Win32_System_Com"]

[workspace]
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.2.2"
version = "1.3.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.2.2/uuid).
For more details on using `uuid`, [see the library documentation](https://docs.rs/uuid/1.3.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.2.2/uuid).
* [`uuid` library docs](https://docs.rs/uuid/1.3.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.2.2"
version = "1.3.0"
edition = "2018"
authors = [
"QnnOkabayashi"
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -134,7 +134,7 @@ impl fmt::Display for Error {
ErrorKind::Char {
character, index, ..
} => {
write!(f, "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `{}` at {}", character, index)
write!(f, "invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `{}` at {}", character, index)
}
ErrorKind::SimpleLength { len } => {
write!(
4 changes: 4 additions & 0 deletions src/external/arbitrary_support.rs
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ impl Arbitrary<'_> for Uuid {

Ok(Builder::from_random_bytes(b).into_uuid())
}

fn size_hint(depth: usize) -> (usize, Option<usize>) {
(16, Some(16))
}
}

#[cfg(test)]
2 changes: 1 addition & 1 deletion src/external/serde_support.rs
Original file line number Diff line number Diff line change
@@ -302,7 +302,7 @@ mod serde_tests {
fn test_de_failure() {
serde_test::assert_de_tokens_error::<Readable<Uuid>>(
&[Token::Str("hello_world")],
"UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-zA-Z], found `h` at 1",
"UUID parsing failed: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found `h` at 1",
);

serde_test::assert_de_tokens_error::<Compact<Uuid>>(
12 changes: 2 additions & 10 deletions src/fmt.rs
Original file line number Diff line number Diff line change
@@ -42,22 +42,14 @@ impl fmt::Display for Variant {

impl fmt::LowerHex for Uuid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if f.alternate() {
fmt::LowerHex::fmt(self.as_simple(), f)
} else {
fmt::LowerHex::fmt(self.as_hyphenated(), f)
}
fmt::LowerHex::fmt(self.as_hyphenated(), f)
}
}

impl fmt::UpperHex for Uuid {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if f.alternate() {
fmt::UpperHex::fmt(self.as_simple(), f)
} else {
fmt::UpperHex::fmt(self.as_hyphenated(), f)
}
fmt::UpperHex::fmt(self.as_hyphenated(), f)
}
}

12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
//!
//! ```toml
//! [dependencies.uuid]
//! version = "1.2.2"
//! version = "1.3.0"
//! features = [
//! "v4", # Lets you generate random UUIDs
//! "fast-rng", # Use a faster (but still sufficiently random) RNG
@@ -138,7 +138,7 @@
//!
//! ```toml
//! [dependencies.uuid]
//! version = "1.2.2"
//! version = "1.3.0"
//! features = [
//! "v4",
//! "v7",
@@ -153,7 +153,7 @@
//!
//! ```toml
//! [dependencies.uuid]
//! version = "1.2.2"
//! version = "1.3.0"
//! default-features = false
//! ```
//!
@@ -211,7 +211,7 @@
#![doc(
html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
html_root_url = "https://docs.rs/uuid/1.2.2"
html_root_url = "https://docs.rs/uuid/1.3.0"
)]

#[cfg(any(feature = "std", test))]
@@ -1219,8 +1219,8 @@ mod tests {
check!(buf, "{:X}", u, 36, |c| c.is_uppercase()
|| c.is_digit(10)
|| c == '-');
check!(buf, "{:#x}", u, 32, |c| c.is_lowercase() || c.is_digit(10));
check!(buf, "{:#X}", u, 32, |c| c.is_uppercase() || c.is_digit(10));
check!(buf, "{:#x}", u, 36, |c| c.is_lowercase() || c.is_digit(10) || c == '-');
check!(buf, "{:#X}", u, 36, |c| c.is_uppercase() || c.is_digit(10) || c == '-');

check!(buf, "{:X}", u.hyphenated(), 36, |c| c.is_uppercase()
|| c.is_digit(10)
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ define_uuid_macro! {
/// Provides the following compilation error:
///
/// ```txt
/// error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found Z at 9
/// error: invalid character: expected an optional prefix of `urn:uuid:` followed by [0-9a-fA-F-], found Z at 9
/// |
/// | let id = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4");
/// | ^