From 3c2f9da5b7855a6f8aedc38e3e9c417967e42415 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 1 Jul 2024 17:03:53 +0200 Subject: [PATCH] clippy --- src/capture.rs | 4 ++-- src/capture/error.rs | 2 +- src/emulate.rs | 4 ++-- src/emulate/error.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/capture.rs b/src/capture.rs index 9b438ef..8b100ca 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -33,7 +33,7 @@ pub mod dummy; pub async fn create_backend( backend: CaptureBackend, ) -> Result>>, 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( diff --git a/src/capture/error.rs b/src/capture/error.rs index 0b60443..c7cf41f 100644 --- a/src/capture/error.rs +++ b/src/capture/error.rs @@ -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}") } diff --git a/src/emulate.rs b/src/emulate.rs index d7d8b0a..07b7cb4 100644 --- a/src/emulate.rs +++ b/src/emulate.rs @@ -48,7 +48,7 @@ pub trait InputEmulation: Send { pub async fn create_backend( backend: EmulationBackend, ) -> Result, 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( diff --git a/src/emulate/error.rs b/src/emulate/error.rs index 10c799d..60f7c95 100644 --- a/src/emulate/error.rs +++ b/src/emulate/error.rs @@ -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}") }