From cd71271f0d990e016dc15207411e01ed4614f8af Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 9 Jun 2017 07:33:22 -0700 Subject: [PATCH] Fix api_transition ControlFlow update compile errors --- src/api_transition.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api_transition.rs b/src/api_transition.rs index 645dc59e..34448801 100644 --- a/src/api_transition.rs +++ b/src/api_transition.rs @@ -32,7 +32,7 @@ macro_rules! gen_api_transition { callback(::Event::Awakened); } - let mut windows = self.windows.lock().unwrap(); + let windows = self.windows.lock().unwrap(); for window in windows.iter() { for event in window.poll_events() { callback(::Event::WindowEvent { @@ -44,7 +44,7 @@ macro_rules! gen_api_transition { } pub fn run_forever(&mut self, mut callback: F) - where F: FnMut(::Event) -> ControlFlow, + where F: FnMut(::Event) -> ::ControlFlow, { self.awakened.store(false, ::std::sync::atomic::Ordering::Relaxed); @@ -59,7 +59,7 @@ macro_rules! gen_api_transition { if let ::ControlFlow::Complete = control_flow { break; } - ::std::thread::sleep_ms(5); + ::std::thread::sleep(::std::time::Duration::from_millis(5)); } } @@ -111,7 +111,7 @@ macro_rules! gen_api_transition { events_loop.windows.lock().unwrap().push(win.clone()); Ok(Window2 { window: win, - events_loop: ::std::sync::Arc::downgrade(&events_loop.windows), + windows: ::std::sync::Arc::downgrade(&events_loop.windows), }) }