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.
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_iterfunction is not useful. Implementations of theDistributiontrait are required to still return aDistIterstruct, which means that the only sensible implementation ofDistribution::sample_iteris to use the default implementation.So we might as well move the implementation of
Distribution::sample_iterintoRng::sample_iterand get rid ofDistribution::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)andrng.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.