Use INT in examples instead of i64.
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user