Skip to content

Commit

Permalink
Make sample code complete
Browse files Browse the repository at this point in the history
  • Loading branch information
TonalidadeHidrica committed Feb 17, 2021
1 parent 328f334 commit 911fea4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sdl2/event.rs
Expand Up @@ -242,7 +242,11 @@ impl crate::EventSubsystem {
///
/// # Example: dump every event to stderr
/// ```
/// let _event_watch = event_subsystem.add_event_watch(|event| {
/// let sdl = sdl2::init().unwrap();
/// let ev = sdl.event().unwrap();
///
/// // `let _ = ...` is insufficient, as it is dropped immediately.
/// let _event_watch = ev.add_event_watch(|event| {
/// dbg!(event);
/// });
/// ```
Expand Down

0 comments on commit 911fea4

Please sign in to comment.