From dbe38ff49ade182711e1cb275b1af2d3eecae663 Mon Sep 17 00:00:00 2001 From: Andrey Lesnikov Date: Thu, 8 Jan 2015 20:57:04 +0300 Subject: android: Updated for Rust ea6f65c5f 2015-01-06 --- src/android/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/android/mod.rs b/src/android/mod.rs index 7e1c35d..0dbe164 100644 --- a/src/android/mod.rs +++ b/src/android/mod.rs @@ -1,6 +1,7 @@ extern crate android_glue; use libc; +use std::ffi::{CString}; use std::sync::mpsc::{Receiver, channel}; use {CreationError, Event, WindowBuilder}; use CreationError::OsError; @@ -257,12 +258,9 @@ impl Window { } pub fn get_proc_address(&self, addr: &str) -> *const () { - use std::c_str::ToCStr; - + let addr = CString::from_slice(addr.as_bytes()).as_slice_with_nul().as_ptr(); unsafe { - addr.with_c_str(|s| { - ffi::egl::GetProcAddress(s) as *const () - }) + ffi::egl::GetProcAddress(addr) as *const () } } -- cgit v1.2.3