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

bump rhai version #2196

Merged
merged 4 commits into from
Jul 9, 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
4 changes: 2 additions & 2 deletions 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 fud2/fud-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ camino = "1.1.6"
anyhow.workspace = true
log.workspace = true
env_logger.workspace = true
rhai = { version = "1.18.0", features = ["internals"] }
rhai = { version = "1.19.0", features = ["internals"] }
once_cell = "1.19.0"
ariadne = "0.4.1"
itertools.workspace = true
Expand Down
12 changes: 7 additions & 5 deletions fud2/fud-core/src/script/plugin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
exec::{OpRef, SetupRef, StateRef},
exec::{SetupRef, StateRef},
DriverBuilder,
};
use std::{
Expand Down Expand Up @@ -185,13 +185,14 @@ impl ScriptRunner {

fn reg_rule(&mut self, sctx: ScriptContext) {
let bld = Rc::clone(&self.builder);
self.engine.register_fn::<_, 4, true, OpRef, true, _>(
self.engine.register_fn(
"rule",
move |ctx: rhai::NativeCallContext,
setups: rhai::Array,
input: StateRef,
output: StateRef,
rule_name: &str| {
rule_name: &str|
-> RhaiResult<_> {
let setups = sctx.setups_array(&ctx, setups)?;
let op =
bld.borrow_mut().rule(&setups, input, output, rule_name);
Expand All @@ -208,14 +209,15 @@ impl ScriptRunner {

fn reg_op(&mut self, sctx: ScriptContext) {
let bld = Rc::clone(&self.builder);
self.engine.register_fn::<_, 5, true, OpRef, true, _>(
self.engine.register_fn(
"op",
move |ctx: rhai::NativeCallContext,
name: &str,
setups: rhai::Array,
input: StateRef,
output: StateRef,
build: rhai::FnPtr| {
build: rhai::FnPtr|
-> RhaiResult<_> {
let setups = sctx.setups_array(&ctx, setups)?;
let rctx = RhaiSetupCtx {
path: sctx.path.clone(),
Expand Down
Loading