Refine examples.

This commit is contained in:
Stephen Chung
2021-02-20 23:46:25 +08:00
parent 54e26059dc
commit 03c31a969a
7 changed files with 53 additions and 25 deletions

View File

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