Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard should be implemented for NonZero types #727

joshlf opened this Issue Feb 12, 2019 · 2 comments


None yet
2 participants
Copy link

joshlf commented Feb 12, 2019

Now that the standard library NonZeroXXX types have been stabilized, Standard should support them.


This comment has been minimized.

Copy link

TheIronBorn commented Feb 12, 2019

In the meantime, this should work:

let distr = Uniform::new_inclusive(1, u32::max_value()); 
let sample = rng.sample(distr); 
// or
NonZeroI32::new(sample as i32)

This comment has been minimized.

Copy link

joshlf commented Feb 12, 2019

@TheIronBorn Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.