From a920359c9a8f254bbfb6c1d04f2bda6365c09c6b Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 15 Sep 2023 17:38:24 -0500 Subject: simplify some code related to Account being a component --- azalea/src/swarm/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'azalea/src') diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index ba38a17e..66e5ea23 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -547,9 +547,11 @@ impl Swarm { } } cloned_bots.lock().remove(&bot.entity); - let owned_account = cloned_bot.component::(); + let account = cloned_bot + .get_component::() + .expect("bot is missing required Account component"); swarm_tx - .send(SwarmEvent::Disconnect(Box::new(owned_account))) + .send(SwarmEvent::Disconnect(Box::new(account))) .unwrap(); }); -- cgit v1.2.3