commit
4627fb22a5
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,6 +1,15 @@
|
|||||||
Rhai Release Notes
|
Rhai Release Notes
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
Version 1.15.1
|
||||||
|
==============
|
||||||
|
|
||||||
|
Bug fixes
|
||||||
|
---------
|
||||||
|
|
||||||
|
* `Dynamic::deep_scan` is fixed so now it properly scans arrays, object maps and function pointers embedded inside data.
|
||||||
|
|
||||||
|
|
||||||
Version 1.15.0
|
Version 1.15.0
|
||||||
==============
|
==============
|
||||||
|
|
||||||
@ -14,6 +23,7 @@ Enhancements
|
|||||||
|
|
||||||
* Expressions involving `this` should now run slightly faster due to a dedicated `AST` node `ThisPtr`.
|
* Expressions involving `this` should now run slightly faster due to a dedicated `AST` node `ThisPtr`.
|
||||||
* A `take` function is added to the standard library to take ownership of any data (replacing with `()`) in order to avoid cloning.
|
* A `take` function is added to the standard library to take ownership of any data (replacing with `()`) in order to avoid cloning.
|
||||||
|
* `Dynamic::take` is added to take ownership of the data (replacing with `()`) in order to avoid cloning.
|
||||||
* `EvalAltResult::ErrorMismatchOutputType` now gives a better name for the requested generic type (e.g. `&str` is now `&str` and not `string`).
|
* `EvalAltResult::ErrorMismatchOutputType` now gives a better name for the requested generic type (e.g. `&str` is now `&str` and not `string`).
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ members = [".", "codegen"]
|
|||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "rhai"
|
name = "rhai"
|
||||||
version = "1.15.0"
|
version = "1.15.1"
|
||||||
rust-version = "1.61.0"
|
rust-version = "1.61.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
@ -2107,6 +2107,8 @@ impl Dynamic {
|
|||||||
#[allow(clippy::only_used_in_recursion)]
|
#[allow(clippy::only_used_in_recursion)]
|
||||||
pub fn deep_scan(&mut self, mut filter: impl FnMut(&mut Self)) {
|
pub fn deep_scan(&mut self, mut filter: impl FnMut(&mut Self)) {
|
||||||
fn scan_inner(value: &mut Dynamic, filter: &mut impl FnMut(&mut Dynamic)) {
|
fn scan_inner(value: &mut Dynamic, filter: &mut impl FnMut(&mut Dynamic)) {
|
||||||
|
filter(value);
|
||||||
|
|
||||||
match &mut value.0 {
|
match &mut value.0 {
|
||||||
#[cfg(not(feature = "no_index"))]
|
#[cfg(not(feature = "no_index"))]
|
||||||
Union::Array(a, ..) => a.iter_mut().for_each(|v| scan_inner(v, filter)),
|
Union::Array(a, ..) => a.iter_mut().for_each(|v| scan_inner(v, filter)),
|
||||||
@ -2117,7 +2119,6 @@ impl Dynamic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filter(self);
|
|
||||||
scan_inner(self, &mut filter);
|
scan_inner(self, &mut filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user