diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index e4b69a7e..1170ea08 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0" proc-macro = true [dev-dependencies] -rhai = { path = "..", version = "0.19.15" } +rhai = { path = "..", version = "^0.19.15" } trybuild = "1" [dependencies] diff --git a/codegen/tests/test_functions.rs b/codegen/tests/test_functions.rs index 86def42e..9becd777 100644 --- a/codegen/tests/test_functions.rs +++ b/codegen/tests/test_functions.rs @@ -1,4 +1,3 @@ -use rhai::module_resolvers::*; use rhai::plugin::*; use rhai::{Engine, EvalAltResult, Module, FLOAT}; @@ -152,10 +151,8 @@ pub mod raw_returning_fn { y1: FLOAT, x2: FLOAT, y2: FLOAT, - ) -> Result> { - Ok(Dynamic::from( - ((y2 - y1).abs().powf(2.0) + (x2 - x1).abs().powf(2.0)).sqrt(), - )) + ) -> Result> { + Ok(((y2 - y1).abs().powf(2.0) + (x2 - x1).abs().powf(2.0)).sqrt()) } } diff --git a/codegen/tests/test_modules.rs b/codegen/tests/test_modules.rs index 0e63dad7..98764d7e 100644 --- a/codegen/tests/test_modules.rs +++ b/codegen/tests/test_modules.rs @@ -1,4 +1,3 @@ -use rhai::module_resolvers::*; use rhai::{Array, Engine, EvalAltResult, FLOAT, INT}; pub mod empty_module { diff --git a/codegen/tests/test_nested.rs b/codegen/tests/test_nested.rs index 62428282..ede543c1 100644 --- a/codegen/tests/test_nested.rs +++ b/codegen/tests/test_nested.rs @@ -1,5 +1,4 @@ -use rhai::module_resolvers::*; -use rhai::{Array, Engine, EvalAltResult, FLOAT, INT}; +use rhai::{Array, Engine, EvalAltResult, FLOAT}; pub mod one_fn_module_nested_attr { use rhai::plugin::*; @@ -10,8 +9,8 @@ pub mod one_fn_module_nested_attr { use rhai::FLOAT; #[rhai_fn(return_raw)] - pub fn get_mystic_number() -> Result> { - Ok(Dynamic::from(42.0 as FLOAT)) + pub fn get_mystic_number() -> Result> { + Ok(42.0) } } } @@ -39,8 +38,8 @@ pub mod one_fn_sub_module_nested_attr { use rhai::plugin::*; use rhai::FLOAT; #[rhai_fn(return_raw)] - pub fn get_mystic_number() -> Result> { - Ok(Dynamic::from(42.0 as FLOAT)) + pub fn get_mystic_number() -> Result> { + Ok(42.0) } } }