From 3f6deb8e2ffa22403aca9fcf6b50bdccc75dc3cf Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sun, 25 Sep 2016 19:49:44 -0700 Subject: Refactor EventLoop into event_loop module This type and its implementations were seriously cluttering main.rs. --- src/input.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index b2263d6e..0251b5f8 100644 --- a/src/input.rs +++ b/src/input.rs @@ -29,6 +29,7 @@ use glutin::{ElementState, VirtualKeyCode}; use glutin::{Mods, mods}; use term::mode::{self, TermMode}; +use event_loop; /// Processes input from glutin. /// @@ -47,14 +48,14 @@ pub trait Notify { fn notify>>(&mut self, B); } -pub struct LoopNotifier(pub ::mio::channel::Sender<::EventLoopMessage>); +pub struct LoopNotifier(pub ::mio::channel::Sender); impl Notify for LoopNotifier { fn notify(&mut self, bytes: B) where B: Into> { let bytes = bytes.into(); - match self.0.send(::EventLoopMessage::Input(bytes)) { + match self.0.send(event_loop::Msg::Input(bytes)) { Ok(_) => (), Err(_) => panic!("expected send event loop msg"), } -- cgit