Make API chainable.
This commit is contained in:
@@ -25,8 +25,10 @@ fn test_mismatched_op_custom_type() {
|
||||
}
|
||||
|
||||
let mut engine = Engine::new();
|
||||
engine.register_type_with_name::<TestStruct>("TestStruct");
|
||||
engine.register_fn("new_ts", TestStruct::new);
|
||||
|
||||
engine
|
||||
.register_type_with_name::<TestStruct>("TestStruct")
|
||||
.register_fn("new_ts", TestStruct::new);
|
||||
|
||||
assert!(matches!(
|
||||
*engine.eval::<INT>("60 + new_ts()").expect_err("should error"),
|
||||
|
Reference in New Issue
Block a user