Skip to content

Commit e3d70f6

Browse files
committed
Sync with master
1 parent 56dc1f8 commit e3d70f6

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

examples/game-of-life-unsafe-textures.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ mod game_of_life {
8686

8787
pub fn update(&mut self) {
8888
let mut new_playground = self.playground;
89-
for (u, mut square) in new_playground.iter_mut().enumerate() {
89+
for (u, square) in new_playground.iter_mut().enumerate() {
9090
let u = u as u32;
9191
let x = u % PLAYGROUND_WIDTH;
9292
let y = u / PLAYGROUND_WIDTH;
@@ -252,7 +252,7 @@ pub fn main() {
252252
let x = (x as u32) / SQUARE_SIZE;
253253
let y = (y as u32) / SQUARE_SIZE;
254254
match game.get_mut(x as i32, y as i32) {
255-
Some(mut square) => {*square = !(*square);},
255+
Some(square) => {*square = !(*square);},
256256
None => {panic!()}
257257
};
258258
},

examples/game-of-life.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ mod game_of_life {
115115
}
116116
}
117117

118-
fn dummy_texture<'a>(canvas: &mut Canvas<Window>, texture_creator: &'a TextureCreator<WindowContext>) -> (Texture<'a>, Texture<'a>) {
118+
fn dummy_texture<'a>(canvas: &mut Canvas<Window>, texture_creator: &'a TextureCreator<WindowContext>) -> (Texture, Texture) {
119119
enum TextureColor {
120120
Yellow,
121121
White,

examples/resource-manager.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn main() {
7070
}
7171
}
7272

73-
type TextureManager<'l, T> = ResourceManager<'l, String, Texture<'l>, TextureCreator<T>>;
73+
type TextureManager<'l, T> = ResourceManager<'l, String, Texture, TextureCreator<T>>;
7474
type FontManager<'l> = ResourceManager<'l, FontDetails, Font<'l, 'static>, Sdl2TtfContext>;
7575

7676
// Generic struct to cache any resource loaded by a ResourceLoader
@@ -113,7 +113,7 @@ impl<'l, K, R, L> ResourceManager<'l, K, R, L>
113113
}
114114

115115
// TextureCreator knows how to load Textures
116-
impl<'l, T> ResourceLoader<'l, Texture<'l>> for TextureCreator<T> {
116+
impl<'l, T> ResourceLoader<'l, Texture> for TextureCreator<T> {
117117
type Args = str;
118118
fn load(&'l self, path: &str) -> Result<Texture, String> {
119119
println!("LOADED A TEXTURE");

src/sdl2/mixer/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ use std::ffi::{CString, CStr};
2727
use std::str::from_utf8;
2828
use std::borrow::ToOwned;
2929
use std::path::Path;
30-
use libc::{c_int, uint16_t, c_double, c_uint, c_void};
30+
use std::os::raw::c_void;
31+
use libc::{c_int, uint16_t, c_double, c_uint};
3132
use ::get_error;
3233
use ::rwops::RWops;
3334
use ::version::Version;
35+
use sys;
3436

3537
// Setup linking for all targets.
3638
#[cfg(target_os="macos")]
@@ -793,7 +795,7 @@ impl<'a> Music<'a> {
793795
/// Load music from a static byte buffer.
794796
pub fn from_static_bytes(buf: &'static [u8]) -> Result<Music<'static>, String> {
795797
let rw = unsafe {
796-
::sys::rwops::SDL_RWFromConstMem(buf.as_ptr() as *const c_void, buf.len() as c_int)
798+
sys::SDL_RWFromConstMem(buf.as_ptr() as *const c_void, buf.len() as c_int)
797799
};
798800

799801
if rw.is_null() {

0 commit comments

Comments
 (0)