mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 11:21:30 +11:00
Make example code a bit smaller
This commit is contained in:
parent
804f86a878
commit
219065a8c4
14
README.md
14
README.md
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue