schungx / rhai

Rhai - An embedded scripting language for Rust [dev repo, may regularly force-push, pull from https://github.com/rhaiscript/rhai for a stable build]
https://github.com/rhaiscript/rhai
Apache License 2.0
9 stars 3 forks source link

codegen: replace downcast_clone with more efficient mem::take #31

Closed jhwgh1968 closed 4 years ago

jhwgh1968 commented 4 years ago

In fact, this PR removes the Dynamic::downcast_clone method entirely.

I wrote it just for my macro code, and (based on other recent API changes) it seems to add little value.

jhwgh1968 commented 4 years ago

I just realized that I used std::mem::take in my code without thinking, yet the no_std build passed. That tells me there is a testing hole.

If you don't mind, I'd like to fix that in a separate PR. I'd like to use this as a bug it could catch.