Skip to content

Commit

Permalink
feat: impl AsRef for Outgoing and Incoming
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianSpeitel committed Jul 10, 2024
1 parent feb594e commit f5b4b2b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ impl<T> Deref for Incoming<T> {
}
}

impl<T> AsRef<T> for Incoming<T> {
fn as_ref(&self) -> &T {
&self.0
}
}

/// Bevy Event for outgoing IRC messages and commands
#[derive(Event, Debug, Clone)]
pub struct Outgoing<T = irc::Message>(pub(crate) T);
Expand All @@ -196,6 +202,12 @@ impl<T> Deref for Outgoing<T> {
}
}

impl<T> AsRef<T> for Outgoing<T> {
fn as_ref(&self) -> &T {
&self.0
}
}

impl Outgoing<irc::Command> {
/// Create a new outgoing command event
#[inline]
Expand Down

0 comments on commit f5b4b2b

Please sign in to comment.