Optimize in-place.

This commit is contained in:
Stephen Chung
2020-11-12 12:37:42 +08:00
parent 7b27dcdd62
commit 41c815f355
2 changed files with 322 additions and 368 deletions

View File

@@ -40,9 +40,8 @@ fn test_bool_op_short_circuit() -> Result<(), Box<EvalAltResult>> {
engine.eval::<bool>(
r"
let x = true;
x || { throw; };
"
"
)?,
true
);
@@ -51,9 +50,8 @@ fn test_bool_op_short_circuit() -> Result<(), Box<EvalAltResult>> {
engine.eval::<bool>(
r"
let x = false;
x && { throw; };
"
"
)?,
false
);
@@ -68,10 +66,9 @@ fn test_bool_op_no_short_circuit1() {
assert!(engine
.eval::<bool>(
r"
let x = true;
x | { throw; }
"
let x = true;
x | { throw; }
"
)
.is_err());
}
@@ -83,10 +80,9 @@ fn test_bool_op_no_short_circuit2() {
assert!(engine
.eval::<bool>(
r"
let x = false;
x & { throw; }
"
let x = false;
x & { throw; }
"
)
.is_err());
}