If checked_add performs addition that returns None instead of wrapping around on overflow then won't it always return either a value or None? If so, when would the default case ever happen? And, if it never happens then shouldn't it be removed? And, if it should be removed then isn't it then the same as the sample_single_value without the unbiased feature (Canon's method, biased)?
In
sample_single_inclusive
with featureunbiased
: https://github.com/rust-random/rand/blob/bca078e929bdf2a1e1730cf394e497e3d0732605/src/distributions/uniform.rs#L620If
checked_add
performs addition that returns None instead of wrapping around on overflow then won't it always return either a value or None? If so, when would the default case ever happen? And, if it never happens then shouldn't it be removed? And, if it should be removed then isn't it then the same as thesample_single_value
without theunbiased
feature (Canon's method, biased)?