diff --git a/src/sdl2/event.rs b/src/sdl2/event.rs index 26b44d3a..fabf9834 100644 --- a/src/sdl2/event.rs +++ b/src/sdl2/event.rs @@ -201,7 +201,7 @@ pub enum Event { User(u32, video::Window, u32, i32), } -impl ::std::fmt::Show for Event { +impl ::std::fmt::Debug for Event { fn fmt(&self, out: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { out.write_str(match *self { Event::None => "Event::None", diff --git a/src/sdl2/render.rs b/src/sdl2/render.rs index 15d5564a..6fd47058 100644 --- a/src/sdl2/render.rs +++ b/src/sdl2/render.rs @@ -8,14 +8,13 @@ use SdlResult; use std::mem; use std::ptr; use std::raw; -use libc::{c_int, c_uint, uint32_t, c_float, c_double, c_void}; +use libc::{c_int, uint32_t, c_float, c_double, c_void}; use rect::Point; use rect::Rect; use std::cell::{RefCell, RefMut}; use std::ffi::c_str_to_bytes; use std::num::FromPrimitive; use std::vec::Vec; -use std::borrow::ToOwned; use std::marker::ContravariantLifetime; use sys::render as ll; @@ -515,6 +514,7 @@ impl RenderDrawer { } } +#[allow(missing_copy_implementations)] pub struct RenderTarget { raw: *const ll::SDL_Renderer } @@ -749,23 +749,19 @@ impl<'renderer> Texture<'renderer> { } pub unsafe fn gl_bind_texture(&mut self) -> (f32, f32) { - unsafe { - let texw = 0.0; - let texh = 0.0; + let texw = 0.0; + let texh = 0.0; - if ll::SDL_GL_BindTexture(self.raw, &texw, &texh) == 0 { - (texw, texh) - } else { - panic!("OpenGL texture binding not supported"); - } + if ll::SDL_GL_BindTexture(self.raw, &texw, &texh) == 0 { + (texw, texh) + } else { + panic!("OpenGL texture binding not supported"); } } pub unsafe fn gl_unbind_texture(&mut self) { - unsafe { - if ll::SDL_GL_UnbindTexture(self.raw) != 0 { - panic!("OpenGL texture unbinding not supported"); - } + if ll::SDL_GL_UnbindTexture(self.raw) != 0 { + panic!("OpenGL texture unbinding not supported"); } } diff --git a/src/sdl2/version.rs b/src/sdl2/version.rs index 42b57a66..cf2d6604 100644 --- a/src/sdl2/version.rs +++ b/src/sdl2/version.rs @@ -28,7 +28,7 @@ impl Version { } } -impl fmt::Show for Version { +impl fmt::Display for Version { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}.{}.{}", self.major, self.minor, self.patch) }