smol-rs / fastrand

A simple and fast random number generator
Apache License 2.0
386 stars 33 forks source link

Add #[must_use] to Rng::with_seed #46

Closed taiki-e closed 1 year ago

taiki-e commented 1 year ago

Hopefully, this will reduce confusion like #45.

warning: unused return value of `Rng::with_seed` that must be used
  --> tests/smoke.rs:35:5
   |
35 |     fastrand::Rng::with_seed(1);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this creates a new instance of `Rng`; if you want to initialize the thread-local generator, use `fastrand::seed()` instead