File tree 2 files changed +5
-6
lines changed
crates/bevy_ecs/src/world
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ impl<'w> EntityRef<'w> {
149
149
) -> Option < MutUntyped < ' w > > {
150
150
self . world . components ( ) . get_info ( component_id) ?;
151
151
// SAFETY: entity_location is valid, component_id is valid as checked by the line above, world access is promised by the caller
152
- unsafe { get_mut_by_id ( self . world , self . entity , self . location , component_id) }
152
+ get_mut_by_id ( self . world , self . entity , self . location , component_id)
153
153
}
154
154
}
155
155
Original file line number Diff line number Diff line change @@ -1427,20 +1427,19 @@ impl World {
1427
1427
1428
1428
let column = self . get_populated_resource_column ( component_id) ?;
1429
1429
1430
- // SAFETY: get_data_ptr requires that the mutability rules are not violated, and the caller promises
1431
- // to only modify the resource while the mutable borrow of the world is valid
1432
1430
let ticks = Ticks {
1433
1431
// SAFETY:
1434
1432
// - index is in-bounds because the column is initialized and non-empty
1435
1433
// - no other reference to the ticks of the same row can exist at the same time
1436
- component_ticks : unsafe { & mut * column. get_ticks_unchecked ( 0 ) . get ( ) } ,
1434
+ component_ticks : & mut * column. get_ticks_unchecked ( 0 ) . get ( ) ,
1437
1435
last_change_tick : self . last_change_tick ( ) ,
1438
1436
change_tick : self . read_change_tick ( ) ,
1439
1437
} ;
1440
1438
1441
1439
Some ( MutUntyped {
1442
- // SAFETY: world access is unique, so no other reference can exist at the same time
1443
- value : unsafe { column. get_data_ptr ( ) . assert_unique ( ) } ,
1440
+ // SAFETY: get_data_ptr requires that the mutability rules are not violated, and the caller promises
1441
+ // to only modify the resource while the mutable borrow of the world is valid
1442
+ value : column. get_data_ptr ( ) . assert_unique ( ) ,
1444
1443
ticks,
1445
1444
} )
1446
1445
}
You can’t perform that action at this time.
0 commit comments