From e89cb041899214df31bc3f5e32cfe90948f80551 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Tue, 8 Dec 2015 23:08:52 +0100 Subject: [PATCH] Rust format --- examples/noise.rs | 7 ++++++- src/windows.rs | 11 +++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/noise.rs b/examples/noise.rs index 523a02a..c860419 100644 --- a/examples/noise.rs +++ b/examples/noise.rs @@ -12,7 +12,12 @@ fn main() { let mut buffer: [u32; WIDTH * HEIGHT] = [0; WIDTH * HEIGHT]; - let mut window = Window::new("Noise Test - Press ESC to exit", WIDTH, HEIGHT, Scale::X1, Vsync::No).unwrap(); + let mut window = Window::new("Noise Test - Press ESC to exit", + WIDTH, + HEIGHT, + Scale::X1, + Vsync::No) + .unwrap(); while window.update(&buffer) { for i in buffer.iter_mut() { diff --git a/src/windows.rs b/src/windows.rs index 6df07a2..c97ee1e 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -9,8 +9,6 @@ use Scale; use Vsync; use Key; -//use Keys; - use std::ffi::CString; use std::ptr; use std::os::windows::ffi::OsStrExt; @@ -261,7 +259,12 @@ impl Window { } } - pub fn new(name: &str, width: usize, height: usize, scale: Scale, vsync: Vsync) -> Result { + pub fn new(name: &str, + width: usize, + height: usize, + scale: Scale, + vsync: Vsync) + -> Result { unsafe { let handle = Self::open_window(name, width, height, scale, vsync); @@ -270,7 +273,7 @@ impl Window { } let window = Window { - dc: Some(user32::GetDC(handle)), + dc: Some(user32::GetDC(handle)), window: Some(handle), keys: [false; 512], buffer: Vec::new(),