From 4c4d0916fd736fcf28d5ee0f80a0fb367de4a0d8 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Sun, 19 Apr 2020 19:55:10 +0200 Subject: [PATCH] control_flow example: fix wait_cancelled logic again (#1511) --- examples/control_flow.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/control_flow.rs b/examples/control_flow.rs index 13b5bcf8..6d715412 100644 --- a/examples/control_flow.rs +++ b/examples/control_flow.rs @@ -41,15 +41,9 @@ fn main() { println!("{:?}", event); match event { Event::NewEvents(start_cause) => { - wait_cancelled = mode == Mode::WaitUntil; - match start_cause { - StartCause::ResumeTimeReached { - start: _, - requested_resume: _, - } => { - wait_cancelled = false; - } - _ => (), + wait_cancelled = match start_cause { + StartCause::WaitCancelled { .. } => mode == Mode::WaitUntil, + _ => false, } } Event::WindowEvent { event, .. } => match event {