rhai/examples/hello.rs
2019-09-18 11:21:07 +01:00

10 lines
184 B
Rust

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