Implement From<&'w mut EntityMut> for EntityMut<'w> (#12896)
# Objective - Implement `From<&'w mut EntityMut>` for `EntityMut<'w>`; - Make it possible to pass `&mut EntityMut` where `impl Into<EntityMut>` is required; - Helps with #12895. ## Solution - Implement `From<&'w mut EntityMut>` for `EntityMut<'w>` --- ## Changelog - `EntityMut<'w>` now implements `From<&'w mut EntityMut>`
This commit is contained in:
parent
6c485c80e0
commit
4227781e8c
@ -469,6 +469,12 @@ impl<'w> EntityMut<'w> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'w> From<&'w mut EntityMut<'_>> for EntityMut<'w> {
|
||||
fn from(value: &'w mut EntityMut<'_>) -> Self {
|
||||
value.reborrow()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'w> From<EntityWorldMut<'w>> for EntityMut<'w> {
|
||||
fn from(value: EntityWorldMut<'w>) -> Self {
|
||||
// SAFETY: `EntityWorldMut` guarantees exclusive access to the entire world.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user