mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
fix demo: use unboxed return type
This commit is contained in:
+3
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user