fn flush_resize_events(event: Event) -> ((u16, u16), (u16, u16)) {
    if let Event::Resize(x, y) = event {
        let mut last_resize = (x, y);
        while let Ok(true) = poll(Duration::from_millis(50)) {
            if let Ok(Event::Resize(x, y)) = read() {
                last_resize = (x, y);
            }
        }

        return ((x, y), last_resize);
    }
    ((0, 0), (0, 0))
}
// Resize events can occur in batches.
// With a simple loop they can be flushed.
// This function will keep the first and last resize event.
Resize events can occur in batches.
With a simple loop they can be flushed.
This function will keep the first and last resize event.
Resize events can occur in batches . With a simple loop they can be flushed . This function will keep the first and last resize event .
fn flush_resize_events(event: Event) -> ((u16, u16), (u16, u16)) {
    if let Event::Resize(x, y) = event {
        let mut last_resize = (x, y);
        while let Ok(true) = poll(Duration::from_millis(50)) {
            if let Ok(Event::Resize(x, y)) = read() {
                last_resize = (x, y);
            }
        }
        return ((x, y), last_resize);
    }
    ((0, 0), (0, 0))
}
fn flush_resize_events ( event : Event ) -> ( ( u16 , u16 ) , ( u16 , u16 ) ) { if let Event :: Resize ( x , y ) = event { let mut last_resize = ( x , y ) ; while let Ok ( true ) = poll ( Duration :: from_millis ( 50 ) ) { if let Ok ( Event :: Resize ( x , y ) ) = read ( ) { last_resize = ( x , y ) ; } } return ( ( x , y ) , last_resize ) ; } ( ( 0 , 0 ) , ( 0 , 0 ) ) }
Resize events can occur in batches.
Resize events can occur in batches .
event
Event
event
Event