From ea3e8600126a58f5666d50fbf70dff8209d8979f Mon Sep 17 00:00:00 2001 From: mat Date: Tue, 5 Dec 2023 10:55:20 -0600 Subject: make start return never --- azalea/src/swarm/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'azalea/src/swarm') diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index d485eb30..1c89cdbe 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -292,7 +292,7 @@ where /// that implements `TryInto`. /// /// [`ServerAddress`]: azalea_protocol::ServerAddress - pub async fn start(self, address: impl TryInto) -> Result<(), StartError> { + pub async fn start(self, address: impl TryInto) -> Result { assert_eq!( self.accounts.len(), self.states.len(), @@ -351,7 +351,7 @@ where let accounts = self.accounts.clone(); let states = self.states.clone(); - let join_task = tokio::spawn(async move { + tokio::spawn(async move { if let Some(join_delay) = join_delay { // if there's a join delay, then join one by one for (account, state) in accounts.iter().zip(states) { @@ -412,9 +412,9 @@ where } } - join_task.abort(); - - Ok(()) + unreachable!( + "bots_rx.recv() should never be None because the bots_tx channel is never closed" + ); } } -- cgit v1.2.3