Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
700: Add into_inner method to ArcData r=toasteater a=Waridley As discussed in Discord, this method is especially useful for coercing the `script` of an `Instance` into a trait object, thus being able to benefit from more Rust conveniences within Godot scripts. This *could* be written as an `impl<T> Into<Arc<T>> for ArcData<T>`, but I feel like this makes it more clear that it's not expected for the user to be able to freely treat `ArcData` as an `Arc` whenever they want to, but rather must be explicit about accessing the internals of this type -- even if it should theoretically be as memory-safe as using the `ArcData` anyway. I decided to have this method take ownership of `self` because if you have reference to an `ArcData`, you should still be able to call `clone()` on it to get an owned copy, but the opposite would not be as easy if the user didn't want to increment the ref count. Co-authored-by: Waridley <Waridley64@gmail.com>
- Loading branch information