rhai/examples/hello.rs
2020-03-09 16:54:43 +08:00

12 lines
226 B
Rust

use rhai::{Engine, EvalAltResult};
fn main() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();
let result = engine.eval::<i64>("40 + 2")?;
println!("Answer: {}", result); // prints 42
Ok(())
}