From 3fcc864a7bc847d70fe929728e83509bd4cff456 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Fri, 27 Dec 2024 11:07:52 +0100 Subject: [PATCH] fix: Avoid depending on an unreleased const_random --- Cargo.toml | 3 --- src/lib.rs | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 206a469..6d4249b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,9 +62,6 @@ smart-leds = { version = "0.4.0", features = ["serde"] } serde = { version = "1.0.215", default-features = false, features = ["alloc"] } portable-atomic = { version = "1.10.0", default-features = false } -[patch.crates-io] -# TODO: Remove this override once https://github.com/tkaitchuck/constrandom/issues/36 has been resolved -const-random-macro = { git = 'https://github.com/tkaitchuck/constrandom.git', rev = "4f71cb510e77eb6a26f8c7296c17811d0416fd41"} [features] default = ["uuid-id"] diff --git a/src/lib.rs b/src/lib.rs index d74481e..fa0767b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,25 @@ macro_rules! mk_static { pub const SSID: &str = env!("SSID"); pub const PASSWORD: &str = env!("PASSWORD"); -const UUID_SEED: [u8; 16] = const_random::const_random!([u8; 16]); +// TODO: Remove this horrible workaround once https://github.com/tkaitchuck/constrandom/issues/36 has been resolved +const UUID_SEED: [u8; 16] = [ + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), + const_random::const_random!(u8), +]; /// Produce an urn that can be used as id pub fn get_urn_or_uuid(stack: Stack) -> String {