diff --git a/Cargo.toml b/Cargo.toml index 8c5951f..a223167 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,21 +51,21 @@ harness = false [dependencies] clap = { version = "2.33.3", optional = true } -num-rational = "0.3.2" -num-bigint = "0.3.1" +num-rational = "0.4" +num-bigint = "0.4" num-traits = "0.2.14" once_cell = "1.5.2" -rand = { version = "0.7.3", optional = true } +rand = { version = "0.8", optional = true } codemap = "0.1.3" -peekmore = "0.5.6" +peekmore = "1.0" wasm-bindgen = { version = "0.2.68", optional = true } -beef = "0.4.4" -phf = { version = "0.8.0", features = ["macros"] } +beef = "0.5" +phf = { version = "0.9", features = ["macros"] } # criterion is not a dev-dependency because it makes tests take too # long to compile, and you cannot make dev-dependencies optional criterion = { version = "0.3.3", optional = true } indexmap = "1.6.0" -lasso = "0.3.1" +lasso = "0.5" [features] default = ["commandline", "random"] diff --git a/src/builtin/functions/math.rs b/src/builtin/functions/math.rs index 126d87a..3deb68e 100644 --- a/src/builtin/functions/math.rs +++ b/src/builtin/functions/math.rs @@ -130,7 +130,7 @@ pub(crate) fn random(mut args: CallArgs, parser: &mut Parser<'_>) -> SassResult< Value::Null => { let mut rng = rand::thread_rng(); return Ok(Value::Dimension( - Some(Number::from(rng.gen_range(0.0, 1.0))), + Some(Number::from(rng.gen_range(0.0..1.0))), Unit::None, true, )); @@ -173,7 +173,7 @@ pub(crate) fn random(mut args: CallArgs, parser: &mut Parser<'_>) -> SassResult< let mut rng = rand::thread_rng(); Ok(Value::Dimension( - Some(Number::from(rng.gen_range(0, limit) + 1)), + Some(Number::from(rng.gen_range(0..limit) + 1)), Unit::None, true, )) diff --git a/src/builtin/functions/string.rs b/src/builtin/functions/string.rs index 2dbc88b..4a2d150 100644 --- a/src/builtin/functions/string.rs +++ b/src/builtin/functions/string.rs @@ -319,6 +319,7 @@ pub(crate) fn unique_id(args: CallArgs, _: &mut Parser<'_>) -> SassResult let mut rng = thread_rng(); let string = std::iter::repeat(()) .map(|()| rng.sample(Alphanumeric)) + .map(char::from) .take(7) .collect(); Ok(Value::String(string, QuoteKind::None))