diff options
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/event.rs b/src/event.rs index 488ac04..3863b49 100644 --- a/src/event.rs +++ b/src/event.rs @@ -10,3 +10,13 @@ pub enum Event<'a> { Connected, Disconnected } + +impl<'a> Event<'a> { + pub fn to_static(&self) -> Event<'static> { + use Event::*; + match self { + &Command(ref c) => Command(c.to_static()), + _ => unimplemented!() + } + } +} |