diff --git a/src/x11/headless.rs b/src/x11/headless.rs index 7692832c..20d86e3a 100644 --- a/src/x11/headless.rs +++ b/src/x11/headless.rs @@ -5,7 +5,7 @@ use libc; use std::{mem, ptr}; use super::ffi; -fn with_c_str(s: &str, f: F) -> T where F: FnOnce(*const i8) -> T { +fn with_c_str(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_slice_with_nul().as_ptr()) diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 0f74dfee..91d7e073 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -24,7 +24,7 @@ fn ensure_thread_init() { }); } -fn with_c_str(s: &str, f: F) -> T where F: FnOnce(*const i8) -> T { +fn with_c_str(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_slice_with_nul().as_ptr())