From 8d9133d3318c81021b1179f2cafe368650b4e7c8 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Thu, 8 Jan 2015 03:20:11 -0800 Subject: Update to latest Rust nightly --- examples/support/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'examples/support') 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 } } -- cgit v1.2.3