In `rand_distr` we switched all constructors to return a `Result` unless they couldn't fail to avoid having to panic. There is one distribution that didn't get updated: `Bernoulli`, which remains in Rand proper. *Should* we make this return a result? For: - it's consistent - it avoids a panic Against: - it's a breaking change - it's less convenient (though we still have `Rng::gen_bool` for convenience) I think probably we *should*, but would like to hear opinions?
Activity
vks commentedon May 16, 2019
We could also add a new, non-panicking constructor and deprecate the old one.
(I think I would prefer a breaking change to
randthough. I don't expect there is so much code usingBernoullidirectly.)Make `Bernoulli::new` return a `Result`
Make `Bernoulli::new` return a `Result`