From 0c22d75a2e6a88fa8daef1c8c59c34d2f154c6f2 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 15:02:41 +0100 Subject: [PATCH] Satisfy clippy --- crates/horizon-client/src/game/piglins.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/horizon-client/src/game/piglins.rs b/crates/horizon-client/src/game/piglins.rs index 337efe8a6..7e58620bf 100644 --- a/crates/horizon-client/src/game/piglins.rs +++ b/crates/horizon-client/src/game/piglins.rs @@ -30,15 +30,13 @@ impl Game<'_> { /// The `SLOT_NAMES` index `getEquipmentSlotForItem` picks: armour goes /// to its slot, anything else to the main hand. fn piglin_slot(&self, item: &str) -> usize { - let slot = match self + let slot = self .res .items() .get(item) .and_then(|i| i.equip_slot.as_deref()) - { - Some(s @ ("head" | "chest" | "legs" | "feet")) => s, - _ => "mainhand", - }; + .filter(|s| matches!(*s, "head" | "chest" | "legs" | "feet")) + .unwrap_or("mainhand"); SLOT_NAMES.iter().position(|n| *n == slot).unwrap_or(0) } /// `Piglin.canReplaceCurrentItem`: an empty slot takes anything, a wanted