@@ -35,11 +35,11 @@ pub mod winit_exports {
3535}
3636
3737/// Loop wrapping for the winit event loop.
38- pub struct Loop < E : ' static > {
38+ pub struct Loop < E : ' static + std :: fmt :: Debug > {
3939 event_loop : EventLoop < E > ,
4040}
4141
42- pub fn create_event_loop < Events : ' static > ( ) -> Loop < Events > {
42+ pub fn create_event_loop < Events : ' static + std :: fmt :: Debug > ( ) -> Loop < Events > {
4343 let event_loop = EventLoop :: < Events > :: with_user_event ( ) ;
4444 return Loop { event_loop } ;
4545}
@@ -85,11 +85,12 @@ fn construct_window_size(
8585 } ;
8686}
8787
88- pub struct EventLoopPublisher < E : ' static > {
88+ #[ derive( Clone , Debug ) ]
89+ pub struct EventLoopPublisher < E : ' static + std:: fmt:: Debug > {
8990 winit_proxy : EventLoopProxy < E > ,
9091}
9192
92- impl < E : ' static > EventLoopPublisher < E > {
93+ impl < E : ' static + std :: fmt :: Debug > EventLoopPublisher < E > {
9394 /// Instantiate a new EventLoopPublisher from an event loop proxy.
9495 #[ inline]
9596 pub fn new ( winit_proxy : EventLoopProxy < E > ) -> Self {
@@ -99,11 +100,14 @@ impl<E: 'static> EventLoopPublisher<E> {
99100 /// Send an event
100101 #[ inline]
101102 pub fn send_event ( & self , event : E ) {
102- self . winit_proxy . send_event ( event) ;
103+ self
104+ . winit_proxy
105+ . send_event ( event)
106+ . expect ( "Failed to send event" ) ;
103107 }
104108}
105109
106- impl < E : ' static > Loop < E > {
110+ impl < E : ' static + std :: fmt :: Debug > Loop < E > {
107111 pub fn create_publisher ( & mut self ) -> EventLoopPublisher < E > {
108112 let proxy = self . event_loop . create_proxy ( ) ;
109113 return EventLoopPublisher :: new ( proxy) ;
0 commit comments