Skip to content
New issue

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

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

Already on GitHub? # to your account

build(deps): bump rust dependencies #176

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 43 additions & 52 deletions native/rhai_rustler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions native/rhai_rustler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ crate-type = ["cdylib"]

[dependencies]
rhai = { version = "=1.17.1", features = ["sync"] }
rhai-dylib = { version = "0.1.12", features = ["sync"] }
rhai-dylib = { version = "0.2.1", features = ["sync"] }
thiserror = "1.0.56"
rustler = "0.30.0"
rustler = "0.31.0"

[features]
nif_version_2_15 = ["rustler/nif_version_2_15"]
Expand Down
11 changes: 6 additions & 5 deletions native/rhai_rustler/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,20 @@ pub fn to_dynamic<'a>(env: Env<'a>, term: &Term<'a>) -> Dynamic {

for (k, v) in term
.decode::<HashMap<String, Term>>()
.expect("get_type() returned Number but could not decod Hashmap.")
.expect("get_type() returned Map but could not decod Hashmap.")
{
object_map.insert(k.into(), to_dynamic(env, &v));
}
Dynamic::from(object_map)
}
TermType::Float => term
.decode::<f64>()
.map(Dynamic::from)
.expect("get_type() returned Float but could not decode as float."),
TermType::Integer => term
.decode::<i64>()
.map(Dynamic::from)
.or_else(|_| term.decode::<f64>().map(Dynamic::from))
.expect("get_type() returned Number but could not decode as integer or float."),

.expect("get_type() returned Integer but could not decode as integer."),
TermType::Pid => Dynamic::from(()),
TermType::Port => Dynamic::from(()),
TermType::Ref => Dynamic::from(()),
Expand All @@ -88,6 +90,5 @@ pub fn to_dynamic<'a>(env: Env<'a>, term: &Term<'a>) -> Dynamic {
}

TermType::Unknown => Dynamic::from(()),
TermType::Integer => unreachable!(),
}
}
Loading
Loading