mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 05:40:04 -04:00
Removed as_slice_with_nul as CString now derefs to a CStr
This commit is contained in:
@@ -171,7 +171,7 @@ fn init(title: Vec<u16>, builder: BuilderAttribs<'static>, builder_sharelists: O
|
||||
use libc;
|
||||
|
||||
let addr = CString::from_slice(addr.as_bytes());
|
||||
let addr = addr.as_bytes_with_nul().as_ptr();
|
||||
let addr = addr.as_ptr();
|
||||
|
||||
unsafe {
|
||||
gl::wgl::GetProcAddress(addr) as *const libc::c_void
|
||||
|
||||
@@ -192,7 +192,7 @@ impl Window {
|
||||
/// See the docs in the crate root file.
|
||||
pub fn get_proc_address(&self, addr: &str) -> *const () {
|
||||
let addr = CString::from_slice(addr.as_bytes());
|
||||
let addr = addr.as_bytes_with_nul().as_ptr();
|
||||
let addr = addr.as_ptr();
|
||||
|
||||
unsafe {
|
||||
let p = gl::wgl::GetProcAddress(addr) as *const ();
|
||||
|
||||
Reference in New Issue
Block a user