From 0f344087630ae252c9c8f453864e684a1a5405b1 Mon Sep 17 00:00:00 2001 From: Osspial Date: Thu, 23 Aug 2018 20:13:53 -0400 Subject: [PATCH] Improve docs for run and run_return --- src/event_loop.rs | 5 +++-- src/platform/desktop.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/event_loop.rs b/src/event_loop.rs index 447738547..7c7046c9a 100644 --- a/src/event_loop.rs +++ b/src/event_loop.rs @@ -105,8 +105,9 @@ impl EventLoop { MonitorId { inner: self.events_loop.get_primary_monitor() } } - /// Hijacks the calling thread and initializes the `winit` event loop. Can take a - /// `FnMut(Event, &EventLoop) -> ControlFlow` or a custom `EventHandler` type. + /// Hijacks the calling thread and initializes the `winit` event loop with the provided + /// closure. Since the closure is `'static`, it must be a `move` closure if it needs to + /// access any data from the calling context. /// /// Any values not passed to this function will *not* be dropped. #[inline] diff --git a/src/platform/desktop.rs b/src/platform/desktop.rs index 2aaa9cf21..8e14346ef 100644 --- a/src/platform/desktop.rs +++ b/src/platform/desktop.rs @@ -14,8 +14,8 @@ pub trait EventLoopExtDesktop { /// Initializes the `winit` event loop. /// - /// Unlikes `run`, this function accepts non-`'static` closures and returns control flow to the - /// caller when `control_flow` is set to `ControlFlow::Exit`. + /// Unlikes `run`, this function accepts non-`'static` (i.e. non-`move`) closures and returns + /// control flow to the caller when `control_flow` is set to `ControlFlow::Exit`. fn run_return(&mut self, event_handler: F) where F: FnMut(Event, &EventLoop, &mut ControlFlow); }