Change Engine::consume_XXX to Engine::run_XXX.
This commit is contained in:
@@ -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")?;
|
||||
|
||||
|
@@ -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());
|
||||
|
@@ -34,7 +34,7 @@ fn main() {
|
||||
|
||||
// Run script
|
||||
engine
|
||||
.consume(
|
||||
.run(
|
||||
r#"
|
||||
print("Starting script loop...");
|
||||
|
||||
|
Reference in New Issue
Block a user