diff options
author | Austin Bonander <austin.bonander@gmail.com> | 2015-01-08 03:20:11 -0800 |
---|---|---|
committer | Austin Bonander <austin.bonander@gmail.com> | 2015-01-08 03:45:46 -0800 |
commit | 8d9133d3318c81021b1179f2cafe368650b4e7c8 (patch) | |
tree | b9618f4520a57b174dae25ed197ba3fe2c373b2e /examples | |
parent | 25b261975c6756a3e0f9ee36107f185103b35292 (diff) | |
download | glutin-8d9133d3318c81021b1179f2cafe368650b4e7c8.tar.gz glutin-8d9133d3318c81021b1179f2cafe368650b4e7c8.zip |
Update to latest Rust nightly
Diffstat (limited to 'examples')
-rw-r--r-- | examples/support/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/support/mod.rs b/examples/support/mod.rs index 42ce6a4..02079fd 100644 --- a/examples/support/mod.rs +++ b/examples/support/mod.rs @@ -1,6 +1,6 @@ #![cfg(feature = "window")] -#[phase(plugin)] +#[no_link] extern crate gl_generator; use glutin; @@ -23,12 +23,13 @@ pub struct Context { pub fn load(window: &glutin::Window) -> Context { let gl = gl::Gl::load(window); - let version = { - use std::c_str::CString; - unsafe { CString::new(gl.GetString(gl::VERSION) as *const i8, false) } + let version = unsafe { + use std::ffi::c_str_to_bytes; + let ref version = gl.GetString(gl::VERSION) as *const i8; + String::from_utf8_lossy(c_str_to_bytes(version)).into_owned() }; - println!("OpenGL version {}", version.as_str().unwrap()); + println!("OpenGL version {}", version); Context { gl: gl } } |