From f5b4b2b4fc59a9f5c93a53ef6a0a226c66a54452 Mon Sep 17 00:00:00 2001 From: Sebastian Speitel Date: Wed, 10 Jul 2024 18:22:14 +0200 Subject: [PATCH] feat: impl AsRef for Outgoing and Incoming --- src/components.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components.rs b/src/components.rs index f23714a..f5c256d 100644 --- a/src/components.rs +++ b/src/components.rs @@ -184,6 +184,12 @@ impl Deref for Incoming { } } +impl AsRef for Incoming { + fn as_ref(&self) -> &T { + &self.0 + } +} + /// Bevy Event for outgoing IRC messages and commands #[derive(Event, Debug, Clone)] pub struct Outgoing(pub(crate) T); @@ -196,6 +202,12 @@ impl Deref for Outgoing { } } +impl AsRef for Outgoing { + fn as_ref(&self) -> &T { + &self.0 + } +} + impl Outgoing { /// Create a new outgoing command event #[inline]