`OptionalRng` is a hack that is necessary because `Option<&mut R>` is not implicitly reborrowed like `&mut R` is. This causes problems when a variable of type `Option<&mut R>` is moved (eg, in a loop). To overcome this, we define the wrapper `OptionalRng` here that can be borrowed mutably, without fear of being moved.
| 8 | /// To overcome this, we define the wrapper `OptionalRng` here that can be borrowed |
| 9 | /// mutably, without fear of being moved. |
| 10 | pub struct OptionalRng<R>(pub Option<R>); |
| 11 | |
| 12 | impl<R: RngCore> RngCore for OptionalRng<R> { |
| 13 | #[inline] |
no outgoing calls
no test coverage detected