rhai/examples/hello.rs

12 lines
227 B
Rust

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