Skip to content

Commit 620bbbc

Browse files
Add into_inner for ResMut
Direct copy of into_inner for Mut
1 parent 9ae131f commit 620bbbc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/bevy_ecs/src/system/system_param.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ impl<'w, T: Component> DerefMut for ResMut<'w, T> {
367367
}
368368
}
369369

370+
impl<'a, T: Component> ResMut<'a, T> {
371+
pub fn into_inner(self) -> &'a mut T {
372+
self.ticks.set_changed(self.change_tick);
373+
self.value
374+
}
375+
}
376+
370377
/// The [`SystemParamState`] of [`ResMut`].
371378
pub struct ResMutState<T> {
372379
component_id: ComponentId,

0 commit comments

Comments
 (0)