~cuviper


#4 RFE: Wrapper type for usize/isize -- Or really, add shuffle() 4 years ago

Comment by ~cuviper on ~icefox/oorandom

No problem, thanks for considering it.

#4 RFE: Wrapper type for usize/isize -- Or really, add shuffle() 4 years ago

Feature added by ~cuviper on ~icefox/oorandom

#4 RFE: Wrapper type for usize/isize -- Or really, add shuffle() 4 years ago

Ticket created by ~cuviper on ~icefox/oorandom

I noticed in the latest rust-analyzer release that they use oorandom to shuffle indices, which they do with casts between u32 and usize.

It might be nice if oorandom had native support for this, something like RandSize that wraps either Rand32 or Rand64 according to the target pointer width. It would have integer methods rand_usize and rand_isize, no need for floats, and the rest of the API would be the same. I'm not sure what would be best for seed and state types though...