Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
riley-martin committed Jan 18, 2024
1 parent 24feeef commit a6447d4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 37 deletions.
56 changes: 25 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["touchpad", "gestures", "libinput", "multitouch", "linux"]
[dependencies]
clap = { version = "4.0.26", features = ["derive"] }
input = "0.8"
nix = {version = "0.26", features = ["poll"]}
nix = {version = "0.27.1", features = ["poll", "fs"]}
regex = "1.7"
log = "0.4.17"
env_logger = "0.10.0"
Expand Down
12 changes: 7 additions & 5 deletions src/event_handler.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::{
fs::OpenOptions,
os::{
fd::OwnedFd,
unix::prelude::{AsRawFd, IntoRawFd, OpenOptionsExt},
fd::{AsFd, OwnedFd},
unix::prelude::{IntoRawFd, OpenOptionsExt},
},
path::Path,
sync::{Arc, RwLock},
Expand Down Expand Up @@ -79,9 +79,11 @@ impl EventHandler {
}

pub fn main_loop(&mut self, input: &mut Libinput) {
let fds = PollFd::new(input.as_raw_fd(), PollFlags::POLLIN);
let mut cloned = input.clone();
let fd = input.as_fd();
let fds = PollFd::new(&fd, PollFlags::POLLIN);
while poll(&mut [fds], -1).is_ok() {
self.handle_event(input)
self.handle_event(&mut cloned)
.expect("An Error occurred while handling an event");
}
}
Expand Down Expand Up @@ -315,7 +317,7 @@ impl LibinputInterface for Interface {
.read((false) | (flags & OFlag::O_RDWR.bits() != 0))
.write((flags & OFlag::O_WRONLY.bits() != 0) | (flags & OFlag::O_RDWR.bits() != 0))
.open(path)
.map(|file| file.try_into().unwrap())
.map(|file| file.into())
.map_err(|err| err.raw_os_error().unwrap())
}
fn close_restricted(&mut self, fd: OwnedFd) {
Expand Down

0 comments on commit a6447d4

Please sign in to comment.