From ae5c0ea8e5e1ac9571b78281c26b7d63d110f5e5 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 28 Nov 2024 03:22:34 +0000 Subject: [PATCH] improve DataComponentPatch::has and has_kind --- azalea-inventory/src/slot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azalea-inventory/src/slot.rs b/azalea-inventory/src/slot.rs index 19963b34..757dc92d 100644 --- a/azalea-inventory/src/slot.rs +++ b/azalea-inventory/src/slot.rs @@ -217,11 +217,11 @@ impl DataComponentPatch { /// # assert!(!is_edible); /// ``` pub fn has(&self) -> bool { - self.components.contains_key(&T::KIND) + self.has_kind(T::KIND) } pub fn has_kind(&self, kind: DataComponentKind) -> bool { - self.components.contains_key(&kind) + self.get_kind(kind).is_some() } }