rhai/examples/no_std.rs
2020-03-18 12:04:26 +08:00

14 lines
247 B
Rust

#![cfg_attr(feature = "no_std", no_std)]
use rhai::{Engine, EvalAltResult};
fn main() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();
let result = engine.eval::<i64>("40 + 2")?;
assert_eq!(result, 42);
Ok(())
}