diff --git a/Cargo.toml b/Cargo.toml index 0420698c..b5396f99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,8 @@ keywords = [ "scripting" ] categories = [ "no-std", "embedded", "wasm", "parser-implementations" ] [dependencies] -smallvec = { version = "1.4.2", default-features = false } +smallvec = { version = "1.4", default-features = false } +fxhash = { version = "0.2" } rhai_codegen = { version = "0.3", path = "codegen" } [features] diff --git a/README.md b/README.md index 82aa7dec..32d52752 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Standard features * Freely pass Rust variables/constants into a script via an external [`Scope`](https://rhaiscript.github.io/book/rust/scope.html) - all clonable Rust types are supported; no need to implement any special trait. * Easily [call a script-defined function](https://rhaiscript.github.io/book/engine/call-fn.html) from Rust. * Relatively little `unsafe` code (yes there are some for performance reasons). -* Few dependencies (currently only [`smallvec`](https://crates.io/crates/smallvec)). +* Few dependencies (currently only [`smallvec`](https://crates.io/crates/smallvec) and [`fxhash`](https://crates.io/crates/fxhash)). * Re-entrant scripting engine can be made `Send + Sync` (via the `sync` feature). * Scripts are [optimized](https://rhaiscript.github.io/book/engine/optimize.html) (useful for template-based machine-generated scripts) for repeated evaluations. * Easy custom API development via [plugins](https://rhaiscript.github.io/book/plugins/index.html) system powered by procedural macros. diff --git a/src/utils.rs b/src/utils.rs index 6931476a..e92bcefa 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -61,8 +61,10 @@ impl BuildHasher for StraightHasherBuilder { pub fn get_hasher() -> impl Hasher { #[cfg(feature = "no_std")] let s: ahash::AHasher = Default::default(); + // #[cfg(not(feature = "no_std"))] + // let s = crate::stdlib::collections::hash_map::DefaultHasher::new(); #[cfg(not(feature = "no_std"))] - let s = crate::stdlib::collections::hash_map::DefaultHasher::new(); + let s: fxhash::FxHasher64 = Default::default(); s }