diff options
| author | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-02-22 23:01:54 +0000 |
| commit | 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 (patch) | |
| tree | 7920fec1203e8e96463a142f5f6da6164e76e684 /azalea/src/swarm | |
| parent | bdd2fc91e11e2896d8e1c7046df247e1075bd40d (diff) | |
| download | azalea-drasl-34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6.tar.xz | |
update to rust edition 2024
Diffstat (limited to 'azalea/src/swarm')
| -rw-r--r-- | azalea/src/swarm/mod.rs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 696f751b..cc0d7eb1 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -9,14 +9,14 @@ pub mod prelude; use std::{collections::HashMap, future::Future, net::SocketAddr, sync::Arc, time::Duration}; use azalea_client::{ - chat::ChatPacket, start_ecs_runner, Account, Client, DefaultPlugins, Event, JoinError, - StartClientOpts, + Account, Client, DefaultPlugins, Event, JoinError, StartClientOpts, chat::ChatPacket, + start_ecs_runner, }; -use azalea_protocol::{resolver, ServerAddress}; +use azalea_protocol::{ServerAddress, resolver}; use azalea_world::InstanceContainer; use bevy_app::{App, PluginGroup, PluginGroupBuilder, Plugins}; use bevy_ecs::{component::Component, entity::Entity, system::Resource, world::World}; -use futures::future::{join_all, BoxFuture}; +use futures::future::{BoxFuture, join_all}; use parking_lot::{Mutex, RwLock}; use tokio::sync::mpsc; use tracing::{debug, error}; @@ -692,14 +692,17 @@ impl Swarm { .min(Duration::from_secs(15)); let username = account.username.clone(); - if let JoinError::Disconnect { reason } = &e { - error!( - "Error joining as {username}, server says: \"{reason}\". Waiting {delay:?} and trying again." - ); - } else { - error!( - "Error joining as {username}: {e}. Waiting {delay:?} and trying again." - ); + match &e { + JoinError::Disconnect { reason } => { + error!( + "Error joining as {username}, server says: \"{reason}\". Waiting {delay:?} and trying again." + ); + } + _ => { + error!( + "Error joining as {username}: {e}. Waiting {delay:?} and trying again." + ); + } } tokio::time::sleep(delay).await; |
