diff --git a/input-capture/src/error.rs b/input-capture/src/error.rs index 449775b..35b7839 100644 --- a/input-capture/src/error.rs +++ b/input-capture/src/error.rs @@ -1,4 +1,3 @@ -use reis::tokio::EiConvertEventStreamError; use thiserror::Error; #[cfg(all(unix, feature = "wayland", not(target_os = "macos")))] @@ -11,7 +10,7 @@ use wayland_client::{ }; #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] -use reis::tokio::HandshakeError; +use reis::tokio::{EiConvertEventStreamError, HandshakeError}; #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[derive(Debug, Error)] @@ -35,10 +34,13 @@ pub enum CaptureError { EndOfStream, #[error("io error: `{0}`")] Io(#[from] std::io::Error), + #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[error("error in libei stream: `{0}`")] Reis(#[from] ReisConvertEventStreamError), + #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[error("libei handshake failed: `{0}`")] Handshake(#[from] HandshakeError), + #[cfg(all(unix, feature = "libei", not(target_os = "macos")))] #[error(transparent)] Portal(#[from] ashpd::Error), } @@ -60,7 +62,7 @@ pub enum CaptureCreationError { #[error("error creating macos capture backend: `{0}`")] Macos(#[from] MacOSInputCaptureCreationError), #[cfg(windows)] - #[error("error creating windows capture backend: `{0}`")] + #[error("error creating windows capture backend")] Windows, } diff --git a/input-capture/src/windows.rs b/input-capture/src/windows.rs index 9a506c4..76fd57e 100644 --- a/input-capture/src/windows.rs +++ b/input-capture/src/windows.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use core::task::{Context, Poll}; use futures::Stream; use once_cell::unsync::Lazy; diff --git a/input-emulation/src/xdg_desktop_portal.rs b/input-emulation/src/xdg_desktop_portal.rs index ad25107..8c6ff0c 100644 --- a/input-emulation/src/xdg_desktop_portal.rs +++ b/input-emulation/src/xdg_desktop_portal.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use ashpd::{ desktop::{ remote_desktop::{Axis, DeviceType, KeyState, RemoteDesktop}, diff --git a/src/server/network_task.rs b/src/server/network_task.rs index f23366f..1e8fb0f 100644 --- a/src/server/network_task.rs +++ b/src/server/network_task.rs @@ -1,6 +1,5 @@ use std::{io, net::SocketAddr}; -use anyhow::Result; use thiserror::Error; use tokio::{ net::UdpSocket, @@ -16,7 +15,7 @@ use super::Server; pub async fn new( server: Server, frontend_notify_tx: Sender, -) -> Result<( +) -> io::Result<( JoinHandle<()>, Sender<(Event, SocketAddr)>, Receiver>, @@ -113,7 +112,7 @@ async fn receive_event(socket: &UdpSocket) -> Result<(Event, SocketAddr), Networ Ok((Event::try_from(buf)?, src)) } -fn send_event(sock: &UdpSocket, e: Event, addr: SocketAddr) -> Result { +fn send_event(sock: &UdpSocket, e: Event, addr: SocketAddr) -> Result { log::trace!("{:20} ------>->->-> {addr}", e.to_string()); let data: Vec = (&e).into(); // When udp blocks, we dont want to block the event loop.