This PR adds an iterator selection function, choice(), that takes an ExactSizeIterator and chooses a random value from it. In addition, I reimplement functions like alphanumeric() using choice().
Right now, the API returns Option<I::Item>, since an iterator could be empty. However, it may be slightly more idiomatic to have it return I::Item and panic if given an empty/buggy iterator.
This PR adds an iterator selection function,
choice()
, that takes anExactSizeIterator
and chooses a random value from it. In addition, I reimplement functions likealphanumeric()
usingchoice()
.Right now, the API returns
Option<I::Item>
, since an iterator could be empty. However, it may be slightly more idiomatic to have it returnI::Item
and panic if given an empty/buggy iterator.