diff --git a/platforms/winit/examples/simple.rs b/platforms/winit/examples/simple.rs index 65a29fdba..9fc0746e2 100644 --- a/platforms/winit/examples/simple.rs +++ b/platforms/winit/examples/simple.rs @@ -132,7 +132,7 @@ impl State { } } -fn main() { +fn main() -> Result<(), impl std::error::Error> { println!("This example has no visible GUI, and a keyboard interface:"); println!("- [Tab] switches focus between two logical buttons."); println!("- [Space] 'presses' the button, adding static text in a live region announcing that it was pressed."); @@ -150,15 +150,14 @@ fn main() { ))] println!("Enable Orca with [Super]+[Alt]+[S]."); - let event_loop = EventLoopBuilder::with_user_event().build().unwrap(); + let event_loop = EventLoopBuilder::with_user_event().build()?; let state = State::new(); let window = WindowBuilder::new() .with_title(WINDOW_TITLE) .with_visible(false) - .build(&event_loop) - .unwrap(); + .build(&event_loop)?; let adapter = { let state = Arc::clone(&state); @@ -174,7 +173,7 @@ fn main() { window.set_visible(true); - let _ = event_loop.run(move |event, event_loop| { + event_loop.run(move |event, event_loop| { event_loop.set_control_flow(ControlFlow::Wait); match event { @@ -231,5 +230,5 @@ fn main() { } _ => (), } - }); + }) }