2 ms·
> Seconded, having to grab 9 crates just to get random numbers in rust is my least favorite thing about the language. I've noticed that crates can often includ
by rascul 4y ago
> Seconded, having to grab 9 crates just to get random numbers in rust is my least favorite thing about the language.
I've noticed that crates can often include default features I don't want or need. If you don't include the default features ('cargo add --no-default-features rand' is what I did) then the only other crate pulled in is rand_core. I've gotten into the habit of reviewing the features and only including the ones I need. I don't know if there's a better solution that could be implemented somewhere upstream but this works for me.
- galangalalgol 4y agoThanks that is a great tip!