Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid depending on an unreleased const_random #17

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
20 changes: 19 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down