Use INT in examples instead of i64.

This commit is contained in:
Stephen Chung
2020-03-24 09:49:08 +08:00
parent 1b4bcbcfdf
commit 060a61fc9d
6 changed files with 14 additions and 14 deletions

View File

@@ -1,15 +1,15 @@
use rhai::{Engine, EvalAltResult, RegisterFn};
use rhai::{Engine, EvalAltResult, RegisterFn, INT};
fn main() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();
fn add(x: i64, y: i64) -> i64 {
fn add(x: INT, y: INT) -> INT {
x + y
}
engine.register_fn("add", add);
let result = engine.eval::<i64>("add(40, 2)")?;
let result = engine.eval::<INT>("add(40, 2)")?;
println!("Answer: {}", result); // prints 42