mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 22:00:04 -04:00
Removed as_slice_with_nul as CString now derefs to a CStr
This commit is contained in:
@@ -8,7 +8,7 @@ use super::ffi;
|
||||
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
|
||||
use std::ffi::CString;
|
||||
let c_str = CString::from_slice(s.as_bytes());
|
||||
f(c_str.as_bytes_with_nul().as_ptr())
|
||||
f(c_str.as_ptr())
|
||||
}
|
||||
|
||||
pub struct HeadlessContext {
|
||||
|
||||
@@ -39,7 +39,7 @@ fn ensure_thread_init() {
|
||||
fn with_c_str<F, T>(s: &str, f: F) -> T where F: FnOnce(*const libc::c_char) -> T {
|
||||
use std::ffi::CString;
|
||||
let c_str = CString::from_slice(s.as_bytes());
|
||||
f(c_str.as_bytes_with_nul().as_ptr())
|
||||
f(c_str.as_ptr())
|
||||
}
|
||||
|
||||
struct XWindow {
|
||||
|
||||
Reference in New Issue
Block a user