Add constant NO_POS.

This commit is contained in:
Stephen Chung
2020-11-02 12:50:27 +08:00
parent 6f3ce96d9d
commit d7d6f74dfd
29 changed files with 253 additions and 292 deletions

View File

@@ -117,7 +117,7 @@ pub fn greet(context: NativeCallContext, callback: FnPtr)
The native call context is also useful in another scenario: protecting a function from malicious scripts.
```rust
use rhai::{Dynamic, Array, NativeCallContext, EvalAltResult, Position};
use rhai::{Dynamic, Array, NativeCallContext, EvalAltResult, NO_POS};
use rhai::plugin::*; // a "prelude" import for macros
// This function builds an array of arbitrary size, but is protected
@@ -137,7 +137,7 @@ pub fn grow(context: NativeCallContext, size: i64)
"Size to grow".to_string(),
context.engine().max_array_size(),
size as usize,
Position::none(),
NO_POS,
).into();
}