From ee69aa92802ba9f5becd533465ca1639cb670ace Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 11 Aug 2024 21:48:31 +0200 Subject: feat(ecs): add action to add component(s) to entity --- ecs/src/lock.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ecs/src/lock.rs') diff --git a/ecs/src/lock.rs b/ecs/src/lock.rs index b3c9f57..77213c9 100644 --- a/ecs/src/lock.rs +++ b/ecs/src/lock.rs @@ -57,6 +57,13 @@ where Ok(WriteGuard { inner: guard }) } + + pub fn into_inner(self) -> Value + { + self.inner + .into_inner() + .unwrap_or_else(|err| err.into_inner()) + } } #[derive(Debug, thiserror::Error)] -- cgit v1.2.3-18-g5258