Skip to content

Commit

Permalink
build(deps): bump rust dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrizio Sestito <[email protected]>
  • Loading branch information
fabriziosestito committed Mar 12, 2024
1 parent f53c194 commit 56bdb29
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 102 deletions.
83 changes: 37 additions & 46 deletions native/rhai_rustler/Cargo.lock

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

2 changes: 1 addition & 1 deletion native/rhai_rustler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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.31.0"

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

0 comments on commit 56bdb29

Please sign in to comment.