From c84f5b8fe7b1c96bc77217d487f04363d6cf8ebc Mon Sep 17 00:00:00 2001 From: KodrAus Date: Mon, 1 Nov 2021 11:12:15 +1000 Subject: [PATCH] update docs for random on embedded --- src/builder.rs | 7 ++++++- src/lib.rs | 4 +++- src/v4.rs | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 5359f998..6fc39909 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -127,7 +127,12 @@ impl Uuid { /// uuid.to_hyphenated().to_string(), /// ); /// ``` - pub const fn from_fields_le(d1: u32, d2: u16, d3: u16, d4: &[u8; 8]) -> Uuid { + pub const fn from_fields_le( + d1: u32, + d2: u16, + d3: u16, + d4: &[u8; 8], + ) -> Uuid { Uuid::from_bytes([ d1 as u8, (d1 >> 8) as u8, diff --git a/src/lib.rs b/src/lib.rs index 50b9a247..45e3978e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -114,7 +114,9 @@ //! //! If you need to use `v4` in a no-std environment, you'll need to //! follow [`getrandom`'s docs] on configuring a source of randomness -//! on currently unsupported targets. +//! on currently unsupported targets. Alternatively, you can produce +//! random bytes yourself and then pass them to [`Builder::from_random_bytes`] +//! without enabling the `v4` feature. //! //! # Examples //! diff --git a/src/v4.rs b/src/v4.rs index 20e89b4e..0e693064 100644 --- a/src/v4.rs +++ b/src/v4.rs @@ -7,7 +7,8 @@ impl Uuid { /// as the source of random numbers. If you'd like to use a custom /// generator, don't use this method: generate random bytes using your /// custom generator and pass them to the - /// [`uuid::Builder::from_random_bytes`][from_random_bytes] function instead. + /// [`uuid::Builder::from_random_bytes`][from_random_bytes] function + /// instead. /// /// Note that usage of this method requires the `v4` feature of this crate /// to be enabled.