From d33c138164d069f025439f97920771f1f8c7775e Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 2 Apr 2015 22:04:17 +0200 Subject: Rustup --- examples/support/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/support') diff --git a/examples/support/mod.rs b/examples/support/mod.rs index 94ef1a7..329bd4b 100644 --- a/examples/support/mod.rs +++ b/examples/support/mod.rs @@ -1,5 +1,6 @@ #![cfg(feature = "window")] +use std::ffi::CStr; use glutin; #[cfg(not(target_os = "android"))] @@ -21,8 +22,8 @@ pub fn load(window: &glutin::Window) -> Context { let gl = gl::Gl::load(window); let version = unsafe { - use std::ffi; - String::from_utf8(ffi::c_str_to_bytes(&(gl.GetString(gl::VERSION) as *const i8)).to_vec()).unwrap() + let data = CStr::from_ptr(gl.GetString(gl::VERSION) as *const i8).to_bytes().to_vec(); + String::from_utf8(data).unwrap() }; println!("OpenGL version {}", version); -- cgit v1.2.3