mozilla/rust — pull request #8491 by robertknight (2013-08-13 14:40:30+00:00)
Title: Add RngUtils::sample() method for reservoir sampling from iterators

Fixes #7722

I had a couple of queries:
- Should this return an array or an iterator?
- Should this be a method on iterators or on the rng? I implemented it in RngUtils as it seemed to belong with shuffle().