From cd4668ca725c1a2ac547a065fe2d3280a8efa7f0 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Fri, 18 Jul 2014 18:45:52 -0700 Subject: [PATCH] Update to latest rust. --- src/sdl2/event.rs | 4 ++-- src/sdl2/keyboard.rs | 2 +- src/sdl2/timer.rs | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sdl2/event.rs b/src/sdl2/event.rs index 4bf9dc2f..e463dfe9 100644 --- a/src/sdl2/event.rs +++ b/src/sdl2/event.rs @@ -787,7 +787,7 @@ impl Event { Ok(window) => window, }; - let text = str::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::>().as_slice()).into_string(); + let text = String::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::>().as_slice()).into_string(); TextEditingEvent(event.timestamp as uint, window, text, event.start as int, event.length as int) } @@ -800,7 +800,7 @@ impl Event { Ok(window) => window, }; - let text = str::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::>().as_slice()).into_string(); + let text = String::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::>().as_slice()).into_string(); TextInputEvent(event.timestamp as uint, window, text) } diff --git a/src/sdl2/keyboard.rs b/src/sdl2/keyboard.rs index b387afcb..82f98201 100644 --- a/src/sdl2/keyboard.rs +++ b/src/sdl2/keyboard.rs @@ -85,7 +85,7 @@ pub fn get_keyboard_state() -> HashMap { let mut current = 0; while current < raw.len() { state.insert(FromPrimitive::from_int(current as int).unwrap(), - *raw.get(current) == 1); + raw[current] == 1); current += 1; } diff --git a/src/sdl2/timer.rs b/src/sdl2/timer.rs index 50a66e41..3bd7a7ce 100644 --- a/src/sdl2/timer.rs +++ b/src/sdl2/timer.rs @@ -70,6 +70,7 @@ impl<'a> Timer<'a> { } } +#[unsafe_destructor] impl<'a> Drop for Timer<'a> { fn drop(&mut self) { if self.remove_on_drop {