Skip to content

Commit

Permalink
build(deps): bump rust dependencies (#176)
Browse files Browse the repository at this point in the history
* build(deps): bump rustler from 0.30.0 to 0.31.0 in /native/rhai_rustler

Bumps [rustler](https://github.com/rusterlium/rustler) from 0.30.0 to 0.31.0.
- [Release notes](https://github.com/rusterlium/rustler/releases)
- [Changelog](https://github.com/rusterlium/rustler/blob/master/CHANGELOG.md)
- [Commits](rusterlium/rustler@rustler-0.30.0...rustler-0.31.0)

---
updated-dependencies:
- dependency-name: rustler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* build(deps): bump rust dependencies

Signed-off-by: Fabrizio Sestito <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Fabrizio Sestito <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
fabriziosestito and dependabot[bot] authored Mar 12, 2024
1 parent a01afb6 commit 221d34c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 99 deletions.
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

0 comments on commit 221d34c

Please sign in to comment.