From 25cd1c0b60604655b70d70f8ec33a54853905eea Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 18 Mar 2026 16:28:46 -1030 Subject: optimize pathfinder swarms and write perf guide --- azalea/examples/testbot/killaura.rs | 2 +- azalea/examples/testbot/main.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'azalea/examples/testbot') diff --git a/azalea/examples/testbot/killaura.rs b/azalea/examples/testbot/killaura.rs index 4f29a0f2..136ae7dd 100644 --- a/azalea/examples/testbot/killaura.rs +++ b/azalea/examples/testbot/killaura.rs @@ -6,7 +6,7 @@ use azalea::{ use crate::State; -pub fn tick(bot: Client, state: State) -> anyhow::Result<()> { +pub fn tick(bot: Client, state: State) -> eyre::Result<()> { if !state.killaura { return Ok(()); } diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index f5f6c096..57bdcc72 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -73,8 +73,8 @@ async fn main() -> AppExit { builder .join_delay(Duration::from_millis(100)) .set_swarm_state(SwarmState { - args, - commands: Arc::new(commands), + args: args.into(), + commands: commands.into(), }) // .add_plugins(mspt::MsptPlugin) .start(join_address) @@ -128,11 +128,11 @@ impl State { #[derive(Clone, Default, Resource)] struct SwarmState { - pub args: Args, + pub args: Arc, pub commands: Arc>>, } -async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Result<()> { +async fn handle(bot: Client, event: azalea::Event, state: State) -> eyre::Result<()> { let swarm = bot.resource::(); match event { @@ -201,7 +201,7 @@ async fn handle(bot: Client, event: azalea::Event, state: State) -> anyhow::Resu Ok(()) } -async fn swarm_handle(_swarm: Swarm, event: SwarmEvent, _state: SwarmState) -> anyhow::Result<()> { +async fn swarm_handle(_swarm: Swarm, event: SwarmEvent, _state: SwarmState) -> eyre::Result<()> { match &event { SwarmEvent::Disconnect(account, _join_opts) => { println!("bot got kicked! {}", account.username()); -- cgit v1.2.3