-
-
Notifications
You must be signed in to change notification settings - Fork 486
Description
I might be misunderstanding the purpose of Distribution::sample_iter, in which case feel free to close this issue.
Best I can tell, the Distribution::sample_iter function is not useful. Implementations of the Distribution trait are required to still return a DistIter struct, which means that the only sensible implementation of Distribution::sample_iter is to use the default implementation.
So we might as well move the implementation of Distribution::sample_iter into Rng::sample_iter and get rid of Distribution::sample_iter.
This is arguably somewhat similar to issue 451, in that we currently have two ways of creating an iterator, Uniform::new(1, 30).sample_iter(rng) and rng.sample_iter(Uniform::new(1, 30)), whereas it seems having one would be better.
I'm happy to create a pull request if there's agreement.