diff options
| author | mat <git@matdoes.dev> | 2025-05-07 11:27:58 +0800 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-05-07 11:27:58 +0800 |
| commit | aa0256da102103eedc9897458dd81516962a80a3 (patch) | |
| tree | 9d01f879a7c75750acd8de0c308247c12bbeea9d /azalea/examples | |
| parent | e9452032bfc95cb7ad4a8798b13648e164536cf1 (diff) | |
| download | azalea-drasl-aa0256da102103eedc9897458dd81516962a80a3.tar.xz | |
upgrade rust version and fix clippy warnings
Diffstat (limited to 'azalea/examples')
| -rw-r--r-- | azalea/examples/steal.rs | 9 | ||||
| -rw-r--r-- | azalea/examples/testbot/commands/debug.rs | 2 | ||||
| -rw-r--r-- | azalea/examples/testbot/commands/movement.rs | 2 | ||||
| -rw-r--r-- | azalea/examples/testbot/killaura.rs | 4 | ||||
| -rw-r--r-- | azalea/examples/testbot/main.rs | 2 |
5 files changed, 9 insertions, 10 deletions
diff --git a/azalea/examples/steal.rs b/azalea/examples/steal.rs index 3fa87cc4..028c1b5a 100644 --- a/azalea/examples/steal.rs +++ b/azalea/examples/steal.rs @@ -58,11 +58,10 @@ async fn steal(bot: Client, state: State) -> anyhow::Result<()> { .world() .read() .find_blocks(bot.position(), &azalea::registry::Block::Chest.into()) - .filter( - // filter for chests that haven't been checked - |block_pos| !state.checked_chests.lock().contains(&block_pos), - ) - .next(); + .find( + // find the closest chest that hasn't been checked + |block_pos| !state.checked_chests.lock().contains(block_pos), + ); let Some(chest_block) = chest_block else { break; }; diff --git a/azalea/examples/testbot/commands/debug.rs b/azalea/examples/testbot/commands/debug.rs index 3428d117..31b0ff91 100644 --- a/azalea/examples/testbot/commands/debug.rs +++ b/azalea/examples/testbot/commands/debug.rs @@ -226,7 +226,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { let instance_container = ecs.resource::<InstanceContainer>(); for (instance_name, instance) in &instance_container.instances { - writeln!(report, "- Name: {}", instance_name).unwrap(); + writeln!(report, "- Name: {instance_name}").unwrap(); writeln!(report, "- Reference count: {}", instance.strong_count()) .unwrap(); if let Some(instance) = instance.upgrade() { diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs index 1596ce89..36ff42ff 100644 --- a/azalea/examples/testbot/commands/movement.rs +++ b/azalea/examples/testbot/commands/movement.rs @@ -116,7 +116,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) { get_integer(ctx, "y").unwrap(), get_integer(ctx, "z").unwrap(), ); - println!("{:?}", pos); + println!("{pos:?}"); let source = ctx.source.lock(); source.bot.look_at(pos.center()); 1 diff --git a/azalea/examples/testbot/killaura.rs b/azalea/examples/testbot/killaura.rs index b47ac0df..5458ea4e 100644 --- a/azalea/examples/testbot/killaura.rs +++ b/azalea/examples/testbot/killaura.rs @@ -39,8 +39,8 @@ pub fn tick(bot: Client, state: State) -> anyhow::Result<()> { } } if let Some(nearest_entity) = nearest_entity { - println!("attacking {:?}", nearest_entity); - println!("distance {:?}", nearest_distance); + println!("attacking {nearest_entity:?}"); + println!("distance {nearest_distance:?}"); bot.attack(nearest_entity); } diff --git a/azalea/examples/testbot/main.rs b/azalea/examples/testbot/main.rs index 6733d797..487cea1e 100644 --- a/azalea/examples/testbot/main.rs +++ b/azalea/examples/testbot/main.rs @@ -241,7 +241,7 @@ fn parse_args() -> Args { pathfinder_debug_particles = true; } _ => { - eprintln!("Unknown argument: {}", arg); + eprintln!("Unknown argument: {arg}"); process::exit(1); } } |
