Skip to content

Commit

Permalink
work around lack of dep:x and x/y feature support in 1.63
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Feb 5, 2025
1 parent 2c662f1 commit 6c155b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ v8 = []
js = ["dep:wasm-bindgen"]

rng = ["dep:getrandom"]
rng-getrandom = ["rng", "dep:getrandom", "dep:uuid-rng-internal", "uuid-rng-internal/getrandom"]
rng-rand = ["rng", "dep:rand", "dep:uuid-rng-internal", "uuid-rng-internal/rand"]
rng-getrandom = ["rng", "dep:getrandom", "uuid-rng-internal-lib", "uuid-rng-internal-lib/getrandom"]
rng-rand = ["rng", "dep:rand", "uuid-rng-internal-lib", "uuid-rng-internal-lib/rand"]

fast-rng = ["rng", "dep:rand"]

Expand Down Expand Up @@ -132,7 +132,9 @@ default-features = false
version = "0.3"
optional = true

[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown"))'.dependencies.uuid-rng-internal]
[target.'cfg(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown"))'.dependencies.uuid-rng-internal-lib]
# Work-around lack of support for both `dep:x` and `x/` in MSRV
package = "uuid-rng-internal"
version = "1.12.1"
path = "rng"
optional = true
Expand Down
12 changes: 6 additions & 6 deletions src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ mod imp {
#[cfg(feature = "rng-rand")]
impl Rng for RngImp {
fn u128() -> u128 {
uuid_rng_internal::__private::rand::random()
uuid_rng_internal_lib::__private::rand::random()
}

fn u64() -> u64 {
uuid_rng_internal::__private::rand::random()
uuid_rng_internal_lib::__private::rand::random()
}

fn u16() -> u16 {
uuid_rng_internal::__private::rand::random()
uuid_rng_internal_lib::__private::rand::random()
}
}

Expand All @@ -136,7 +136,7 @@ mod imp {
fn u128() -> u128 {
let mut bytes = [0u8; 16];

uuid_rng_internal::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
uuid_rng_internal_lib::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
// NB: getrandom::Error has no source; this is adequate display
panic!("could not retrieve random bytes for uuid: {}", err)
});
Expand All @@ -147,7 +147,7 @@ mod imp {
fn u64() -> u64 {
let mut bytes = [0u8; 8];

uuid_rng_internal::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
uuid_rng_internal_lib::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
// NB: getrandom::Error has no source; this is adequate display
panic!("could not retrieve random bytes for uuid: {}", err)
});
Expand All @@ -158,7 +158,7 @@ mod imp {
fn u16() -> u16 {
let mut bytes = [0u8; 2];

uuid_rng_internal::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
uuid_rng_internal_lib::__private::getrandom::fill(&mut bytes).unwrap_or_else(|err| {
// NB: getrandom::Error has no source; this is adequate display
panic!("could not retrieve random bytes for uuid: {}", err)
});
Expand Down

0 comments on commit 6c155b4

Please sign in to comment.