mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Update to latest rust.
This commit is contained in:
+2
-2
@@ -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::<Vec<u8>>().as_slice()).into_string();
|
||||
let text = String::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::<Vec<u8>>().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::<Vec<u8>>().as_slice()).into_string();
|
||||
let text = String::from_utf8_lossy(event.text.iter().take_while(|&b| (*b) != 0i8).map(|&b| b as u8).collect::<Vec<u8>>().as_slice()).into_string();
|
||||
TextInputEvent(event.timestamp as uint, window, text)
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ pub fn get_keyboard_state() -> HashMap<ScanCode, bool> {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user