Skip to content

sample with random ordering #169

@TheIronBorn

Description

@TheIronBorn

I was using rand::sample to shuffle an arbitrary number of elements from a list, until I noticed that the ordering was stable, and so no shuffling was happening, only random selection.

Is there reason to add such functionality to the crate? Or is the expected way of doing this shuffling, then slicing? Or sampling, then shuffling?


rand: 0.3.16
rustc: 1.21.0-nightly
cargo: 0.22.0-nightly

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