Update all dependencies

This commit is contained in:
2024-08-02 11:21:48 -07:00
parent d0df73a9c7
commit 2239788f86
23 changed files with 948 additions and 790 deletions

View File

@ -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) }
}