fn is_equipment_update(inv: &InventoryComponent, slot: SlotIndex) -> Result<Equipment, ()> {
    if slot >= SLOT_HOTBAR_OFFSET && slot - SLOT_HOTBAR_OFFSET == inv.held_item {
        Ok(Equipment::MainHand)
    } else if let Some(equipment) = Equipment::from_slot_index(slot) {
        Ok(equipment)
    } else {
        Err(())
    }
}
/// Returns whether the given update to an inventory
/// is an equipment update.
Returns whether the given update to an inventory
is an equipment update.
Returns whether the given update to an inventory is an equipment update .
fn is_equipment_update(inv: &InventoryComponent, slot: SlotIndex) -> Result<Equipment, ()> {
    if slot >= SLOT_HOTBAR_OFFSET && slot - SLOT_HOTBAR_OFFSET == inv.held_item {
        Ok(Equipment::MainHand)
    } else if let Some(equipment) = Equipment::from_slot_index(slot) {
        Ok(equipment)
    } else {
        Err(())
    }
}
fn is_equipment_update ( inv : & InventoryComponent , slot : SlotIndex ) -> Result < Equipment , ( ) > { if slot >= SLOT_HOTBAR_OFFSET && slot - SLOT_HOTBAR_OFFSET == inv . held_item { Ok ( Equipment :: MainHand ) } else if let Some ( equipment ) = Equipment :: from_slot_index ( slot ) { Ok ( equipment ) } else { Err ( ( ) ) } }
Returns whether the given update to an inventory
is an equipment update.
Returns whether the given update to an inventory is an equipment update .
inv
&InventoryComponent
slot
SlotIndex
inv
&InventoryComponent
slot
SlotIndex