From 172cffaad26f3e591f3e99956352d0b4c742df30 Mon Sep 17 00:00:00 2001 From: davidemazzocchi Date: Tue, 30 Sep 2025 12:02:35 +0200 Subject: [PATCH] feat: add has_attribute function to entity --- 01.workspace/heave/src/str/entity.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/01.workspace/heave/src/str/entity.rs b/01.workspace/heave/src/str/entity.rs index 917cb02..979990e 100644 --- a/01.workspace/heave/src/str/entity.rs +++ b/01.workspace/heave/src/str/entity.rs @@ -52,6 +52,9 @@ impl O { Some(attribute) => Some(attribute.value), } } + pub fn has_attribute(&self, id: &str) -> bool { + self.attributes.contains_key(id) + } pub fn unwrap(&self, id: &str) -> T where T: From,