Change Engine::consume_XXX to Engine::run_XXX.

This commit is contained in:
Stephen Chung
2021-08-06 14:46:27 +08:00
parent e0125a1033
commit 180ad77224
23 changed files with 160 additions and 67 deletions

View File

@@ -3,7 +3,7 @@ use rhai::{Engine, EvalAltResult, INT};
fn main() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
engine.consume(r#"print("hello, world!")"#)?;
engine.run(r#"print("hello, world!")"#)?;
let result = engine.eval::<INT>("40 + 2")?;

View File

@@ -61,7 +61,7 @@ fn main() -> Result<(), Box<EvalAltResult>> {
println!("Line: {}", input.replace('\r', "\\r").replace('\n', "\\n"));
engine.consume_with_scope(
engine.run_with_scope(
&mut scope,
r#"
display("Length", x.len());

View File

@@ -34,7 +34,7 @@ fn main() {
// Run script
engine
.consume(
.run(
r#"
print("Starting script loop...");