From 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 22 Feb 2025 23:01:54 +0000 Subject: update to rust edition 2024 --- azalea/src/swarm/mod.rs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'azalea/src/swarm') 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; -- cgit v1.2.3