Skip to content

Commit 008c156

Browse files
refactor: move internals from entity_ref to World, add SAFETY comments (#6402)
# Objective There are some utility functions for actually working with `Storages` inside `entity_ref.rs` that are used both for `EntityRef/EntityMut` and `World`, with a `// TODO: move to Storages`. This PR moves them to private methods on `World`, because that's the safest API boundary. On `Storages` you would need to ensure that you pass `Components` from the same world. ## Solution - move get_component[_with_type], get_ticks[_with_type], get_component_and_ticks[_with_type] to `World` (still pub(crate)) - replace `pub use entity_ref::*;` with `pub use entity_ref::{EntityRef, EntityMut}` and qualified `entity_ref::get_mut[_by_id]` in `world.rs` - add safety comments to a bunch of methods
1 parent feac2c2 commit 008c156

File tree

2 files changed

+323
-312
lines changed

2 files changed

+323
-312
lines changed

0 commit comments

Comments
 (0)