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