mirror of https://github.com/smol-rs/fastrand
Implement crate::get_seed
crate::get_seed calls Rng::get_seed on the thread-local RNG.
This commit is contained in:
parent
803cf086d9
commit
005abc5903
|
@ -591,6 +591,12 @@ pub fn seed(seed: u64) {
|
|||
RNG.with(|rng| rng.seed(seed))
|
||||
}
|
||||
|
||||
/// Gives back **current** seed that is being held by the thread-local generator.
|
||||
#[inline]
|
||||
pub fn get_seed() -> u64 {
|
||||
RNG.with(|rng| rng.get_seed())
|
||||
}
|
||||
|
||||
/// Generates a random `bool`.
|
||||
#[inline]
|
||||
pub fn bool() -> bool {
|
||||
|
|
Loading…
Reference in New Issue