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

@ -24,7 +24,7 @@ difference = "2.0"
lazy_static = "1.2.0"
smallbitvec = "2.3.0"
clap = "2.32"
dirs = "1.0.2"
dirs = "2.0.2"
libloading = "0.5"
once_cell = "0.1.8"
serde = "1.0"
@ -52,6 +52,6 @@ version = "0.4.6"
features = ["std"]
[dev-dependencies]
rand = "0.6.4"
rand = "0.7.0"
spin = "0.5"
tempfile = "3"

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 {