From 96aff4ae46d8d28293dc08a8d78af6454c5ba9cf Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Sat, 26 Jul 2025 18:47:18 -0500 Subject: [PATCH] Chain method calls, drop intermediate vars --- src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9b9d7ce..7f7bec9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -123,18 +123,15 @@ fn spawn_player( ..default() }; - let thruster = commands.spawn(thruster_mesh).id(); - - let mut ship_id = commands.spawn(( + commands.spawn(( Ship, Position(Vec2::default()), Velocity(Vec2::ZERO), Rotation(0.0), ship_mesh, ThrusterColors(thruster_firing_id, thruster_stopped_id), - )); + )).with_child(thruster_mesh); - ship_id.add_child(thruster); } /*