diff --git a/glut.rs b/glut.rs index abd5ad5..7e38361 100644 --- a/glut.rs +++ b/glut.rs @@ -10,7 +10,7 @@ /* automatically generated by rust-bindgen */ use libc::{c_int, c_uint, c_uchar, c_char}; -use std::cast; +use std::mem; use std::ptr::null; /* FIXME: global variable glutStrokeRoman */ @@ -93,13 +93,13 @@ pub fn init() { let glut = "glut"; glut.to_c_str().with_ref(|command| { let argv: (*u8, *u8) = (command as *u8, null()); - let argv_p = cast::transmute(&argv); + let argv_p = mem::transmute(&argv); glutInit(&argc, argv_p); }); } } -pub fn create_window(name: ~str) -> Window { +pub fn create_window(name: String) -> Window { unsafe { name.to_c_str().with_ref(|bytes| { Window(glutCreateWindow(bytes as *c_char)) diff --git a/test.rs b/test.rs index e67cfef..60e5177 100644 --- a/test.rs +++ b/test.rs @@ -26,7 +26,7 @@ use std::comm; use std::io::println; use std::task; -fn fragment_shader_source() -> ~str { +fn fragment_shader_source() -> String { " #ifdef GLES2 precision mediump float; @@ -38,7 +38,7 @@ fn fragment_shader_source() -> ~str { ".to_string() } -fn vertex_shader_source() -> ~str { +fn vertex_shader_source() -> String { " attribute vec3 aVertexPosition; @@ -52,9 +52,9 @@ fn vertex_shader_source() -> ~str { ".to_string() } -fn load_shader(source_str: ~str, shader_type: GLenum) -> GLuint { +fn load_shader(source_str: String, shader_type: GLenum) -> GLuint { let shader_id = create_shader(shader_type); - shader_source(shader_id, [source_str.as_bytes().to_string()]); + shader_source(shader_id, [source_str.as_bytes()]); compile_shader(shader_id); if get_error() != NO_ERROR {