mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 20:09:59 +03:00
clippy
This commit is contained in:
@@ -33,7 +33,7 @@ pub mod dummy;
|
||||
pub async fn create_backend(
|
||||
backend: CaptureBackend,
|
||||
) -> Result<Box<dyn InputCapture<Item = io::Result<(ClientHandle, Event)>>>, CaptureCreationError> {
|
||||
return match backend {
|
||||
match backend {
|
||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||
CaptureBackend::InputCapturePortal => Ok(Box::new(libei::LibeiInputCapture::new().await?)),
|
||||
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
||||
@@ -45,7 +45,7 @@ pub async fn create_backend(
|
||||
#[cfg(target_os = "macos")]
|
||||
CaptureBackend::MacOs => Ok(Box::new(macos::MacOSInputCapture::new()?)),
|
||||
CaptureBackend::Dummy => Ok(Box::new(dummy::DummyInputCapture::new())),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn create(
|
||||
|
||||
@@ -42,7 +42,7 @@ impl Display for CaptureCreationError {
|
||||
CaptureCreationError::Macos(e) => format!("{e}"),
|
||||
#[cfg(windows)]
|
||||
CaptureCreationError::Windows => format!(""),
|
||||
CaptureCreationError::NoAvailableBackend => format!("no available backend"),
|
||||
CaptureCreationError::NoAvailableBackend => "no available backend".to_string(),
|
||||
};
|
||||
write!(f, "could not create input capture: {reason}")
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ pub trait InputEmulation: Send {
|
||||
pub async fn create_backend(
|
||||
backend: EmulationBackend,
|
||||
) -> Result<Box<dyn InputEmulation>, EmulationCreationError> {
|
||||
return match backend {
|
||||
match backend {
|
||||
#[cfg(all(unix, feature = "wayland", not(target_os = "macos")))]
|
||||
EmulationBackend::Wlroots => Ok(Box::new(wlroots::WlrootsEmulation::new()?)),
|
||||
#[cfg(all(unix, feature = "libei", not(target_os = "macos")))]
|
||||
@@ -64,7 +64,7 @@ pub async fn create_backend(
|
||||
#[cfg(target_os = "macos")]
|
||||
EmulationBackend::MacOs => Ok(Box::new(macos::MacOSEmulation::new()?)),
|
||||
EmulationBackend::Dummy => Ok(Box::new(dummy::DummyEmulation::new())),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn create(
|
||||
|
||||
@@ -36,7 +36,7 @@ impl Display for EmulationCreationError {
|
||||
EmulationCreationError::X11(e) => format!("x11 backend: {e}"),
|
||||
#[cfg(target_os = "macos")]
|
||||
EmulationCreationError::MacOs(e) => format!("macos backend: {e}"),
|
||||
EmulationCreationError::NoAvailableBackend => format!("no backend available"),
|
||||
EmulationCreationError::NoAvailableBackend => "no backend available".to_string(),
|
||||
};
|
||||
write!(f, "could not create input emulation backend: {reason}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user