Satisfy clippy

This commit is contained in:
Kacpherek
2026-10-26 15:02:41 +01:00
parent 6875c44bbe
commit 0c22d75a2e
+3 -5
View File
@@ -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