diff --git a/README.md b/README.md index 7789927..59635e9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Usage ```toml # Cargo.toml [dependencies] -minifb = "0.2.3" +minifb = "0.2.4" ``` Example @@ -25,7 +25,7 @@ const WIDTH: usize = 640; const HEIGHT: usize = 360; fn main() { - let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT]; + let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; let mut window = match minifb::Window::new("Test - ESC to exit", WIDTH, HEIGHT, Scale::X1) { Ok(win) => win, diff --git a/examples/noise.rs b/examples/noise.rs index ab39f11..edde38a 100644 --- a/examples/noise.rs +++ b/examples/noise.rs @@ -1,6 +1,6 @@ extern crate minifb; -use minifb::*; +use minifb::{Window, Key, Scale}; const WIDTH: usize = 640; const HEIGHT: usize = 360; @@ -10,7 +10,7 @@ fn main() { let mut carry; let mut seed = 0xbeefu32; - let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT]; + let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; let mut window = match Window::new("Noise Test - Press ESC to exit", WIDTH, HEIGHT, Scale::X2) { Ok(win) => win, diff --git a/src/lib.rs b/src/lib.rs index 2cd143f..51b013b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -183,7 +183,7 @@ use self::os::unix as imp; /// const WIDTH: usize = 640; /// const HEIGHT: usize = 360; /// -/// let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT]; +/// let mut buffer: Vec = vec![0; WIDTH * HEIGHT]; /// /// let mut window = match Window::new("Test - Press ESC to exit", WIDTH, HEIGHT, Scale::X1).unwrap() /// @@ -222,7 +222,7 @@ impl Window { /// # Examples /// /// ```ignore - /// let mut buffer: [u32; 640 * 400] = [0; 640 * 400]; + /// let mut buffer: Vec = vec![0; 640 * 400]; /// /// let mut window = match Window::new("Test", 640, 400, Scale::X1).unwrap(); ///