Use run and i64 instead of eval and INT for examples.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
use rhai::{Engine, EvalAltResult, INT};
|
||||
use rhai::{Engine, EvalAltResult};
|
||||
|
||||
fn main() -> Result<(), Box<EvalAltResult>> {
|
||||
let engine = Engine::new();
|
||||
|
||||
engine.run(r#"print("hello, world!")"#)?;
|
||||
|
||||
let result = engine.eval::<INT>("40 + 2")?;
|
||||
let result = engine.eval::<i64>("40 + 2")?;
|
||||
|
||||
println!("Answer: {}", result); // prints 42
|
||||
|
||||
|
Reference in New Issue
Block a user