mirror of https://github.com/smol-rs/fastrand
Remove unnecesary instantiation
This commit is contained in:
parent
35b0ae32c8
commit
dda0fe824b
|
@ -286,10 +286,7 @@ impl Rng {
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use = "this creates a new instance of `Rng`; if you want to initialize the thread-local generator, use `fastrand::seed()` instead"]
|
#[must_use = "this creates a new instance of `Rng`; if you want to initialize the thread-local generator, use `fastrand::seed()` instead"]
|
||||||
pub fn with_seed(seed: u64) -> Self {
|
pub fn with_seed(seed: u64) -> Self {
|
||||||
let mut rng = Rng(0);
|
Rng(seed)
|
||||||
|
|
||||||
rng.seed(seed);
|
|
||||||
rng
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clones the generator by deterministically deriving a new generator based on the initial
|
/// Clones the generator by deterministically deriving a new generator based on the initial
|
||||||
|
|
Loading…
Reference in New Issue