Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using IndexMap to preserve fields order #784

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 6 additions & 11 deletions Cargo.toml
Expand Up @@ -3,7 +3,7 @@ members = [".", "codegen"]

[package]
name = "rhai"
version = "1.17.1"
version = "1.17.2"
rust-version = "1.66.0"
edition = "2018"
resolver = "2"
Expand All @@ -25,7 +25,7 @@ num-traits = { version = "0.2.0", default-features = false }
once_cell = { version = "1.7.0", default-features = false, features = ["race"] }
bitflags = { version = "2.0.0", default-features = false }
smartstring = { version = "1.0.0", default-features = false }
rhai_codegen = { version = "2.0.0", path = "codegen" }
rhai_codegen = { version = "2.0.0", path = "codegen", package = "rhai_codegen" }

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 }
Expand All @@ -39,6 +39,7 @@ getrandom = { version = "0.2.0", optional = true }
rustyline = { version = "13.0.0", optional = true }
document-features = { version = "0.2.0", optional = true }
arbitrary = { version = "1.3.2", optional = true, features = ["derive"] }
indexmap = { version = "2.2.3", optional = true, features = ["serde"] }

[dev-dependencies]
rmp-serde = "1.1.0"
Expand All @@ -47,14 +48,16 @@ serde_json = { version = "1.0.45", default-features = false, features = ["alloc"
[features]

## Default features: `std`, uses runtime random numbers for hashing.
default = ["std", "ahash/runtime-rng"] # ahash/runtime-rng trumps ahash/compile-time-rng
default = ["std", "ahash/runtime-rng", "indexmap"] # ahash/runtime-rng trumps ahash/compile-time-rng
## Standard features: uses compile-time random number for hashing.
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 = []
## Use IndexMap as Map type
indexmap = ["dep:indexmap"]
## 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).
Expand Down Expand Up @@ -141,14 +144,6 @@ name = "rhai-run"
name = "rhai-dbg"
required-features = ["debugging"]

[[example]]
name = "serde"
required-features = ["serde"]

[[example]]
name = "definitions"
required-features = ["metadata", "internals"]

[profile.release]
lto = "fat"
codegen-units = 1
Expand Down
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Expand Up @@ -24,5 +24,5 @@ syn = { version = "2.0.0", features = ["full", "parsing", "printing", "proc-macr
quote = "1.0.0"

[dev-dependencies]
rhai = { path = "..", version = "1.17.0", features = ["metadata"] }
rhai = { path = "..", features = ["metadata"], package = "rhai" }
trybuild = "1.0.0"