aboutsummaryrefslogtreecommitdiff
path: root/azalea/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-09-15 17:38:24 -0500
committermat <git@matdoes.dev>2023-09-15 17:38:24 -0500
commita920359c9a8f254bbfb6c1d04f2bda6365c09c6b (patch)
treeb0224c13433e0e48732c45434ca29f48290ae215 /azalea/src
parentb6586d500cc01b790aa11b019cca9a829e3efc27 (diff)
downloadazalea-drasl-a920359c9a8f254bbfb6c1d04f2bda6365c09c6b.tar.xz
simplify some code related to Account being a component
Diffstat (limited to 'azalea/src')
-rw-r--r--azalea/src/swarm/mod.rs6
1 files changed, 4 insertions, 2 deletions
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::<Account>();
+ let account = cloned_bot
+ .get_component::<Account>()
+ .expect("bot is missing required Account component");
swarm_tx
- .send(SwarmEvent::Disconnect(Box::new(owned_account)))
+ .send(SwarmEvent::Disconnect(Box::new(account)))
.unwrap();
});