Skip to content

Remove Distribution::sample_iter #455

@sicking

Description

@sicking

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions