diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 6f1f1a1214..16486885b2 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -2949,12 +2949,15 @@ unsafe impl Sync for World {} /// using data from the supplied [`World`]. /// /// This can be helpful for complex initialization or context-aware defaults. +/// +/// [`FromWorld`] is automatically implemented for any type implementing [`Default`]. pub trait FromWorld { /// Creates `Self` using data from the given [`World`]. fn from_world(world: &mut World) -> Self; } impl FromWorld for T { + /// Creates `Self` using [`default()`](`Default::default`). fn from_world(_world: &mut World) -> Self { T::default() }