fix demo: use unboxed return type

This commit is contained in:
Andelf
2014-05-05 21:05:51 +08:00
parent 0d416c89ea
commit 27b51f192f
+3 -3
View File
@@ -21,11 +21,11 @@ pub fn main(png: &Path) {
};
// Load a surface, and convert it to a texture bound to the renderer
let surface: ~sdl2::surface::Surface = match LoadSurface::from_file(png) {
let surface = match LoadSurface::from_file(png) {
Ok(surface) => surface,
Err(err) => fail!(format!("Failed to load png: {}", err))
};
let texture = match renderer.create_texture_from_surface(surface) {
let texture = match renderer.create_texture_from_surface(&surface) {
Ok(texture) => texture,
Err(err) => fail!(format!("Failed to create surface: {}", err))
};
@@ -36,7 +36,7 @@ pub fn main(png: &Path) {
// Err(err) => fail!(format!("Could not set render target: {}", err))
// };
renderer.copy(texture, None, None);
renderer.copy(&texture, None, None);
renderer.present();
'main : loop {