Make example code a bit smaller

This commit is contained in:
Daniel Collin 2016-09-18 10:25:08 +02:00
parent 804f86a878
commit 219065a8c4

View file

@ -31,14 +31,12 @@ const HEIGHT: usize = 360;
fn main() {
let mut buffer: Vec<u32> = 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() {