From dda0fe824b078bc844300db86021c2552465c468 Mon Sep 17 00:00:00 2001 From: Felipe Manzano Date: Tue, 12 Mar 2024 11:25:36 -0300 Subject: [PATCH] Remove unnecesary instantiation --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4b6f18d..a71c748 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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