aboutsummaryrefslogtreecommitdiff
path: root/src/safe_x11/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/safe_x11/mod.rs')
-rw-r--r--src/safe_x11/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/safe_x11/mod.rs b/src/safe_x11/mod.rs
index a65c132..7dcdce1 100644
--- a/src/safe_x11/mod.rs
+++ b/src/safe_x11/mod.rs
@@ -29,7 +29,7 @@ use std::ffi::CString;
use std::ffi::NulError;
use std::ptr;
use std::error;
-use std::mem::uninitialized;
+use std::mem::MaybeUninit;
use std::slice;
use std::fmt;
use libc::c_int;
@@ -81,7 +81,7 @@ pub fn x11_fd(display: *mut Display) -> c_int {
/// on the main thread.
pub fn next_xevent(display: *mut Display) -> XEvent {
unsafe {
- let mut last_event: XEvent = uninitialized();
+ let mut last_event: XEvent = MaybeUninit::uninit().assume_init();
XNextEvent(display, &mut last_event);
last_event
}
@@ -171,7 +171,7 @@ pub fn window_list(display: *mut Display) -> &'static [Window] {
let mut children_count: u32 = 0;
unsafe {
let root_window = XDefaultRootWindow(display);
- let mut children: *mut Window = uninitialized();
+ let mut children: *mut Window = MaybeUninit::uninit().assume_init();
XQueryTree(display, root_window,
&mut root, &mut parent,
&mut children, &mut children_count);
@@ -201,7 +201,7 @@ fn get_color<T: Into<Vec<u8>>>(display: *mut Display, color: T) -> u64{
let screen_num = unsafe { xlib::XDefaultScreen(display) };
let colormap = unsafe { xlib::XDefaultColormap(display, screen_num) };
unsafe {
- let mut xcolor: xlib::XColor = uninitialized();
+ let mut xcolor: xlib::XColor = MaybeUninit::uninit().assume_init();
let cstr = CString::new(color).unwrap();
xlib::XAllocNamedColor(display, colormap, cstr.as_ptr(),
&mut xcolor, &mut xcolor);