Update all dependencies

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

View File

@ -7,13 +7,13 @@ edition = "2021"
[dependencies]
anyhow = "1"
clap = "3"
env_logger = "0.9"
clap = "4"
env_logger = "0.11"
humantime = "2"
lazy_static = "1"
libc = "0.2"
shell-words = "1"
toml = "0.5"
toml = "0.8"
xcb = "1"
xdg = "2"
zbus = "3"
zbus = "4"

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