diff --git a/README.md b/README.md index 46ad66d..efacc23 100644 --- a/README.md +++ b/README.md @@ -31,14 +31,12 @@ const HEIGHT: usize = 360; fn main() { let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; - let mut window = match minifb::Window::new("Test - ESC to exit", WIDTH, HEIGHT, - WindowOptions::default()) { - Ok(win) => win, - Err(err) => { - println!("Unable to create window {}", err); - return; - } - }; + let mut window = Window::new("Test - ESC to exit", + WIDTH, + HEIGHT, + WindowOptions::default()).unwrap_or_else(|e| { + panic!("{}", e); + }); while window.is_open() && !window.is_key_down(Key::Escape) { for i in buffer.iter_mut() {