Upgrade rand, dirs

This commit is contained in:
Max Brunsfeld 2019-08-19 16:36:25 -07:00
parent 9ba5f25594
commit 8e3ff6376f
3 changed files with 71 additions and 44 deletions

View file

@ -1,15 +1,15 @@
use rand::distributions::Alphanumeric;
use rand::prelude::{Rng, SeedableRng, SmallRng};
use rand::prelude::{Rng, SeedableRng, StdRng};
const OPERATORS: &[char] = &[
'+', '-', '<', '>', '(', ')', '*', '/', '&', '|', '!', ',', '.',
];
pub struct Rand(SmallRng);
pub struct Rand(StdRng);
impl Rand {
pub fn new(seed: usize) -> Self {
Rand(SmallRng::seed_from_u64(seed as u64))
Rand(StdRng::seed_from_u64(seed as u64))
}
pub fn unsigned(&mut self, max: usize) -> usize {