@@ -451,7 +451,7 @@ impl<'a> MutUntyped<'a> {
451
451
/// # use bevy_ecs::change_detection::{Mut, MutUntyped};
452
452
/// # let mut_untyped: MutUntyped = unimplemented!();
453
453
/// // SAFETY: ptr is of type `u8`
454
- /// mut_untyped.to_typed (|ptr| unsafe { ptr.deref_mut::<u8>() });
454
+ /// mut_untyped.map_unchanged (|ptr| unsafe { ptr.deref_mut::<u8>() });
455
455
/// ```
456
456
/// If you have a [`ReflectFromPtr`](bevy_reflect::ReflectFromPtr) that you know belongs to this [`MutUntyped`],
457
457
/// you can do
@@ -460,9 +460,9 @@ impl<'a> MutUntyped<'a> {
460
460
/// # let mut_untyped: MutUntyped = unimplemented!();
461
461
/// # let reflect_from_ptr: bevy_reflect::ReflectFromPtr = unimplemented!();
462
462
/// // SAFETY: from the context it is known that `ReflectFromPtr` was made for the type of the `MutUntyped`
463
- /// mut_untyped.to_typed (|ptr| unsafe { reflect_from_ptr.as_reflect_ptr_mut(ptr) });
463
+ /// mut_untyped.map_unchanged (|ptr| unsafe { reflect_from_ptr.as_reflect_ptr_mut(ptr) });
464
464
/// ```
465
- pub fn to_typed < T : ?Sized > ( self , f : impl FnOnce ( PtrMut < ' a > ) -> & ' a mut T ) -> Mut < ' a , T > {
465
+ pub fn map_unchanged < T : ?Sized > ( self , f : impl FnOnce ( PtrMut < ' a > ) -> & ' a mut T ) -> Mut < ' a , T > {
466
466
Mut {
467
467
value : f ( self . value ) ,
468
468
ticks : self . ticks ,
@@ -779,7 +779,7 @@ mod tests {
779
779
780
780
let reflect_from_ptr = <ReflectFromPtr as FromType < i32 > >:: from_type ( ) ;
781
781
782
- let mut new = value. to_typed ( |ptr| {
782
+ let mut new = value. map_unchanged ( |ptr| {
783
783
// SAFETY: ptr has type of ReflectFromPtr
784
784
let value = unsafe { reflect_from_ptr. as_reflect_ptr_mut ( ptr) } ;
785
785
value
0 commit comments