Add Dynamic::clone_cast.

This commit is contained in:
Stephen Chung
2021-03-30 18:57:16 +08:00
parent ec7b906f71
commit b14d18934a
7 changed files with 70 additions and 33 deletions

View File

@@ -56,6 +56,7 @@ Enhancements
* Replaced all `HashMap` usage with `BTreeMap` for better performance because collections in Rhai are tiny.
* `Engine::register_result_fn` no longer requires the successful return type to be `Dynamic`. It can now be any clonable type.
* `#[rhai_fn(return_raw)]` can now return `Result<T, Box<EvalAltResult>>` where `T` is any clonable type instead of `Result<Dynamic, Box<EvalAltResult>>`.
* `Dynamic::clone_cast` is added to simplify casting from a `&Dynamic`.
Version 0.19.14