Remove unnecesary instantiation

This commit is contained in:
Felipe Manzano 2024-03-12 11:25:36 -03:00 committed by John Nunley
parent 35b0ae32c8
commit dda0fe824b
1 changed files with 1 additions and 4 deletions

View File

@ -286,10 +286,7 @@ impl Rng {
#[inline]
#[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 {
let mut rng = Rng(0);
rng.seed(seed);
rng
Rng(seed)
}
/// Clones the generator by deterministically deriving a new generator based on the initial