From 91c97b112009af6f9e25308943a90de1a1674d76 Mon Sep 17 00:00:00 2001 From: Teakowa <27560638+Teakowa@users.noreply.github.com> Date: Sat, 26 Sep 2026 00:06:41 +0800 Subject: [PATCH] deps: bump workshop-rs to v0.7.0 Adopt the non_exhaustive Rule and Condition API by building rules through Rule::new in wright-transform tests. --- Cargo.lock | 4 +- Cargo.toml | 4 +- crates/wright-transform/src/pipeline.rs | 60 +++++++++++------------ crates/wright-transform/tests/pipeline.rs | 12 ++--- 4 files changed, 37 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78a27c0..8521bcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2082,8 +2082,8 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "workshop-rs" -version = "0.6.4" -source = "git+https://github.com/wrightkit/workshop-rs.git?rev=712c839f09f9c4daaf65aa7ae619f4fca065e34d#712c839f09f9c4daaf65aa7ae619f4fca065e34d" +version = "0.7.0" +source = "git+https://github.com/wrightkit/workshop-rs.git?rev=43a8b45f2703903233f4eba6bd27deb9b6ba675f#43a8b45f2703903233f4eba6bd27deb9b6ba675f" dependencies = [ "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 0647e86..b136667 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ license = "AGPL-3.0-or-later" repository = "https://github.com/wrightkit/wright" [workspace.dependencies] -# Canonical Workshop core; pinned to the workshop-rs 1.0 release candidate (workshop-rs v0.6.4). -workshop-rs = { git = "https://github.com/wrightkit/workshop-rs.git", rev = "712c839f09f9c4daaf65aa7ae619f4fca065e34d" } +# Canonical Workshop core; pinned to the workshop-rs 1.0 release candidate (workshop-rs v0.7.0). +workshop-rs = { git = "https://github.com/wrightkit/workshop-rs.git", rev = "43a8b45f2703903233f4eba6bd27deb9b6ba675f" } libc = "0.2" serde = "1" serde_json = "1" diff --git a/crates/wright-transform/src/pipeline.rs b/crates/wright-transform/src/pipeline.rs index 197a892..890c5c0 100644 --- a/crates/wright-transform/src/pipeline.rs +++ b/crates/wright-transform/src/pipeline.rs @@ -330,37 +330,35 @@ mod tests { use workshop_rs::{Action, Condition, Event, Program, Rule, Value}; let mut program = Program::new(); - program.rule(Rule { - name: "r".to_string(), - disabled: false, - event: Event::Global, - conditions: vec![Condition::new(Value::call( - "+", - [Value::call("*", [2.0.into(), 3.0.into()]), 4.0.into()], - ))], - actions: vec![Action::Call { - name: "probe".to_string(), - args: vec![ - Value::Array(vec![ - Value::call("+", [1.0.into(), 2.0.into()]), - Value::call("==", [4.0.into(), 4.0.into()]), - ]), - Value::call("and", [true.into(), false.into()]), - Value::call( - "valueInArray", - [ - Value::Array(vec![1.0.into(), 2.0.into()]), - Value::call("+", [0.0.into(), 0.0.into()]), - ], - ), - Value::Vector { - x: Box::new(0.0.into()), - y: Box::new(1.0.into()), - z: Box::new(0.0.into()), - }, - ], - }], - }); + program.rule( + Rule::new("r", Event::Global) + .condition(Condition::new(Value::call( + "+", + [Value::call("*", [2.0.into(), 3.0.into()]), 4.0.into()], + ))) + .action(Action::Call { + name: "probe".to_string(), + args: vec![ + Value::Array(vec![ + Value::call("+", [1.0.into(), 2.0.into()]), + Value::call("==", [4.0.into(), 4.0.into()]), + ]), + Value::call("and", [true.into(), false.into()]), + Value::call( + "valueInArray", + [ + Value::Array(vec![1.0.into(), 2.0.into()]), + Value::call("+", [0.0.into(), 0.0.into()]), + ], + ), + Value::Vector { + x: Box::new(0.0.into()), + y: Box::new(1.0.into()), + z: Box::new(0.0.into()), + }, + ], + }), + ); let results = run_canonical(&mut program, Profile::Compat).expect("canonical pipeline"); assert!(results[0].stats.changed > 0); diff --git a/crates/wright-transform/tests/pipeline.rs b/crates/wright-transform/tests/pipeline.rs index 1a0257b..fb174b1 100644 --- a/crates/wright-transform/tests/pipeline.rs +++ b/crates/wright-transform/tests/pipeline.rs @@ -17,16 +17,12 @@ fn arithmetic_program() -> Program { let multiply = Value::call("*", [Value::number(2.0), Value::number(3.0)]); let add = Value::call("+", [len, multiply]); - program.rule(Rule { - name: "compute".to_string(), - disabled: false, - event: Event::Global, - conditions: vec![], - actions: vec![Action::SetGlobalVariable { + program.rule( + Rule::new("compute", Event::Global).action(Action::SetGlobalVariable { variable: "result".to_string(), value: add, - }], - }); + }), + ); program }