From 7b373f7ab4efe58c125069eb38c27d3010a51c35 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 6 Apr 2021 19:35:32 +0800 Subject: [PATCH] (test) adopt break changes in rhai 0.19.15 --- Cargo.toml | 2 +- src/registry.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d7a159d9..d20eead3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ pest_derive = "2.1.0" serde = "1.0.0" serde_json = "1.0.39" walkdir = { version = "2.2.3", optional = true } -rhai = { version = "0.19.6", optional = true, features = ["sync", "serde"] } +rhai = { version = "0.19.15", optional = true, features = ["sync", "serde"] } [dev-dependencies] env_logger = "0.8" diff --git a/src/registry.rs b/src/registry.rs index 46f628731..6b56af4e0 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -1035,7 +1035,7 @@ mod test { fn test_script_helper() { let mut reg = Registry::new(); - reg.register_script_helper("acc", "params.reduce(|sum, x| x + sum, || 0 )") + reg.register_script_helper("acc", "params.reduce(|sum, x| x + sum, 0)") .unwrap(); assert_eq!( @@ -1054,7 +1054,7 @@ mod test { let file1_path = dir.path().join("acc.rhai"); { let mut file1: File = File::create(&file1_path).unwrap(); - write!(file1, "params.reduce(|sum, x| x + sum, || 0 )").unwrap(); + write!(file1, "params.reduce(|sum, x| x + sum, 0)").unwrap(); } reg.register_script_helper_file("acc", &file1_path).unwrap(); @@ -1066,7 +1066,7 @@ mod test { { let mut file1: File = File::create(&file1_path).unwrap(); - write!(file1, "params.reduce(|sum, x| x * sum, || 1 )").unwrap(); + write!(file1, "params.reduce(|sum, x| x * sum, 1)").unwrap(); } assert_eq!(