From e283c43ecea774d67b58e1f727bb4cedf4c8f037 Mon Sep 17 00:00:00 2001 From: Jakob Hellermann Date: Mon, 13 Feb 2023 21:49:03 +0100 Subject: [PATCH] docs tweaks --- crates/bevy_ecs/src/change_detection.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/change_detection.rs b/crates/bevy_ecs/src/change_detection.rs index c8effdfafb878c..3c009d14ecebc7 100644 --- a/crates/bevy_ecs/src/change_detection.rs +++ b/crates/bevy_ecs/src/change_detection.rs @@ -445,7 +445,11 @@ impl<'a> MutUntyped<'a> { self.value.as_ref() } - /// Turn this [`MutUntyped`] into a [`Mut`] by mapping the inner [`PtrMut`] to another value. + /// Turn this [`MutUntyped`] into a [`Mut`] by mapping the inner [`PtrMut`] to another value, + /// without flagging a change. [`MutUntyped`] equivalent of [`Mut::map_unchanged`]. + /// + /// You should never modify the argument passed to the closure – if you want to modify the data without flagging a change, consider using [`DetectChanges::bypass_change_detection`](crate::change_detection::DetectChangesMut::bypass to make your intent explicit. + /// /// If you know the type of the value you can do /// ```no_run /// # use bevy_ecs::change_detection::{Mut, MutUntyped};