Skip to content

Commit

Permalink
Improve docs for run and run_return
Browse files Browse the repository at this point in the history
  • Loading branch information
Osspial committed Nov 9, 2018
1 parent fba41f7 commit 0f34408
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ impl<T> EventLoop<T> {
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]
Expand Down
4 changes: 2 additions & 2 deletions src/platform/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<F>(&mut self, event_handler: F)
where F: FnMut(Event<Self::UserEvent>, &EventLoop<Self::UserEvent>, &mut ControlFlow);
}
Expand Down

0 comments on commit 0f34408

Please sign in to comment.