Skip to content

Commit dda0fe8

Browse files
feliamnotgull
authored andcommitted
Remove unnecesary instantiation
1 parent 35b0ae3 commit dda0fe8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/lib.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,7 @@ impl Rng {
286286
#[inline]
287287
#[must_use = "this creates a new instance of `Rng`; if you want to initialize the thread-local generator, use `fastrand::seed()` instead"]
288288
pub fn with_seed(seed: u64) -> Self {
289-
let mut rng = Rng(0);
290-
291-
rng.seed(seed);
292-
rng
289+
Rng(seed)
293290
}
294291

295292
/// Clones the generator by deterministically deriving a new generator based on the initial

0 commit comments

Comments
 (0)