tinyrand_std/
lib.rs

1//! Extensions for using `tinyrand` with `stdlib`.
2
3pub mod clock_seed;
4pub mod thread_local;
5
6pub use clock_seed::ClockSeed;
7pub use thread_local::ThreadLocalRand;
8pub use thread_local::thread_rand;
9
10#[cfg(test)]
11mod tests {
12    /// All this does is print the pointer width. Useful for determining the `usize` width
13    /// of the current platform.
14    #[test]
15    fn pointer_width() {
16        println!("{}-bit", num_bits::<usize>());
17    }
18
19    const fn num_bits<T>() -> usize { std::mem::size_of::<T>() * 8 }
20}