diff --git a/Cargo.toml b/Cargo.toml index d43de4210..f3c1aaba2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,12 +22,12 @@ smallvec = { version = "1.7.0", default-features = false, features = ["union", " thin-vec = { version = "0.2.13", default-features = false } ahash = { version = "0.8.2", default-features = false, features = ["compile-time-rng"] } num-traits = { version = "0.2.0", default-features = false } -once_cell = { version = "1.7.0", default-features = false, features = ["race"] } +once_cell = { version = "1.19.0", default-features = false, features = ["critical-section"] } bitflags = { version = "2.0.0", default-features = false } smartstring = { version = "1.0.0", default-features = false } rhai_codegen = { version = "2.1.0", path = "codegen" } -no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat", version = "0.4.1", default-features = false, features = ["alloc", "compat_sync"], optional = true } +no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat", version = "0.4.1", default-features = false, features = ["alloc"], optional = true } libm = { version = "0.2.0", default-features = false, optional = true } hashbrown = { version = "0.14.0", optional = true } core-error = { version = "0.0.0", default-features = false, features = ["alloc"], optional = true } @@ -54,7 +54,7 @@ std = ["once_cell/std", "ahash/std", "num-traits/std", "smartstring/std"] #! ### Enable Special Functionalities ## Require that all data types implement `Send + Sync` (for multi-threaded usage). -sync = [] +sync = ["no-std-compat/compat_sync"] ## Add support for the [`Decimal`](https://crates.io/crates/rust_decimal) data type (acts as the system floating-point type under `no_float`). decimal = ["rust_decimal"] ## Enable serialization/deserialization of Rhai data types via [`serde`](https://crates.io/crates/serde). diff --git a/src/config/hashing.rs b/src/config/hashing.rs index cf7fcda5f..e6dcee9ae 100644 --- a/src/config/hashing.rs +++ b/src/config/hashing.rs @@ -54,11 +54,7 @@ pub use crate::api::deprecated::config::hashing::{get_ahash_seed, set_ahash_seed /// ``` #[inline(always)] pub fn set_hashing_seed(new_seed: Option<[u64; 4]>) -> Result<(), Option<[u64; 4]>> { - #[cfg(feature = "std")] - return HASHING_SEED.set(new_seed); - - #[cfg(not(feature = "std"))] - return HASHING_SEED.set(new_seed.into()).map_err(|err| *err); + HASHING_SEED.set(new_seed) } /// Get the current hashing Seed. diff --git a/src/lib.rs b/src/lib.rs index 525df595c..d351a60d5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -220,12 +220,8 @@ type ExclusiveRange = std::ops::Range; /// An inclusive integer range. type InclusiveRange = std::ops::RangeInclusive; -#[cfg(feature = "std")] use once_cell::sync::OnceCell; -#[cfg(not(feature = "std"))] -use once_cell::race::OnceBox as OnceCell; - pub use api::build_type::{CustomType, TypeBuilder}; #[cfg(not(feature = "no_custom_syntax"))] pub use api::custom_syntax::Expression;