aboutsummaryrefslogtreecommitdiff
path: root/azalea/examples/steal.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-07 11:27:58 +0800
committermat <git@matdoes.dev>2025-05-07 11:27:58 +0800
commitaa0256da102103eedc9897458dd81516962a80a3 (patch)
tree9d01f879a7c75750acd8de0c308247c12bbeea9d /azalea/examples/steal.rs
parente9452032bfc95cb7ad4a8798b13648e164536cf1 (diff)
downloadazalea-drasl-aa0256da102103eedc9897458dd81516962a80a3.tar.xz
upgrade rust version and fix clippy warnings
Diffstat (limited to 'azalea/examples/steal.rs')
-rw-r--r--azalea/examples/steal.rs9
1 files changed, 4 insertions, 5 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;
};