Update all dependencies
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
use std::{ffi::CStr, io};
|
||||
use std::{ffi::CStr, io, os::fd::{BorrowedFd, RawFd}};
|
||||
use xcb::x;
|
||||
|
||||
pub mod desktop;
|
||||
@ -77,3 +77,10 @@ pub fn get_username() -> io::Result<String> {
|
||||
.map(|s| s.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn borrow_raw_fd<'a>(fd: RawFd) -> BorrowedFd<'a> {
|
||||
if fd < 0 {
|
||||
panic!("Can't borrow invalid file descriptor");
|
||||
}
|
||||
unsafe { BorrowedFd::borrow_raw(fd) }
|
||||
}
|
||||
|
Reference in New Issue
Block a user