Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix. #731

Merged
merged 3 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
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
==============

Expand All @@ -14,6 +23,7 @@ Enhancements

* 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.
* `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`).


Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "codegen"]

[package]
name = "rhai"
version = "1.15.0"
version = "1.15.1"
rust-version = "1.61.0"
edition = "2018"
resolver = "2"
Expand Down
3 changes: 2 additions & 1 deletion src/types/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@
/// Return `true` if the [`Dynamic`] holds a [`FnPtr`].
#[inline]
#[must_use]
pub(crate) fn is_fnptr(&self) -> bool {

Check warning on line 1856 in src/types/dynamic.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest, --features testing-environ,no_time,no_function,no_float,no_position,no_inde...

method `is_fnptr` is never used
match self.0 {
Union::FnPtr(..) => true,
#[cfg(not(feature = "no_closure"))]
Expand Down Expand Up @@ -2107,6 +2107,8 @@
#[allow(clippy::only_used_in_recursion)]
pub fn deep_scan(&mut self, mut filter: impl FnMut(&mut Self)) {
fn scan_inner(value: &mut Dynamic, filter: &mut impl FnMut(&mut Dynamic)) {
filter(value);

match &mut value.0 {
#[cfg(not(feature = "no_index"))]
Union::Array(a, ..) => a.iter_mut().for_each(|v| scan_inner(v, filter)),
Expand All @@ -2117,7 +2119,6 @@
}
}

filter(self);
scan_inner(self, &mut filter);
}
}
Expand Down
Loading