Add more range API's.

This commit is contained in:
Stephen Chung
2021-12-15 22:12:51 +08:00
parent 59a9ff0b0f
commit abbfa3777d
5 changed files with 42 additions and 28 deletions

View File

@@ -542,10 +542,15 @@ mod range_functions {
range.contains(&value)
}
#[rhai_fn(get = "is_inclusive", name = "is_inclusive", pure)]
pub fn range_is_inclusive(range: &mut ExclusiveRange) -> bool {
pub fn is_inclusive(range: &mut ExclusiveRange) -> bool {
let _range = range;
false
}
#[rhai_fn(get = "is_exclusive", name = "is_exclusive", pure)]
pub fn is_exclusive(range: &mut ExclusiveRange) -> bool {
let _range = range;
true
}
#[rhai_fn(get = "is_empty", name = "is_empty", pure)]
pub fn is_empty(range: &mut ExclusiveRange) -> bool {
range.is_empty()
@@ -571,4 +576,9 @@ mod range_functions {
let _range = range;
true
}
#[rhai_fn(get = "is_exclusive", name = "is_exclusive", pure)]
pub fn is_exclusive_inclusive(range: &mut InclusiveRange) -> bool {
let _range = range;
false
}
}