From 250d536e0823334c04301cf5c6b7cb88a944688f Mon Sep 17 00:00:00 2001 From: Russell Greene Date: Sun, 13 Oct 2024 00:52:23 -0600 Subject: [PATCH] clippy --- src/cap_ext_image_copy.rs | 2 +- src/cap_wlr_screencopy.rs | 2 +- src/main.rs | 14 ++++---------- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/cap_ext_image_copy.rs b/src/cap_ext_image_copy.rs index fb2865c..0ed8680 100644 --- a/src/cap_ext_image_copy.rs +++ b/src/cap_ext_image_copy.rs @@ -106,7 +106,7 @@ impl Dispatch for State { let probed = if let ExtImageCopyState::Probing(formats, size, dev) = &state.enc.unwrap_cap().state { - Some((formats.clone(), size.clone(), dev.clone())) + Some((formats.clone(), size, dev.clone())) } else { None }; diff --git a/src/cap_wlr_screencopy.rs b/src/cap_wlr_screencopy.rs index 4b1c02e..054a144 100644 --- a/src/cap_wlr_screencopy.rs +++ b/src/cap_wlr_screencopy.rs @@ -144,7 +144,7 @@ impl CaptureSource for CapWlrScreencopy { // if this doesn't exist, it will get logged later anyways let _ = gm.bind::( - &eq, + eq, WpDrmLeaseDeviceV1::interface().version..=WpDrmLeaseDeviceV1::interface().version, (), ); diff --git a/src/main.rs b/src/main.rs index e1c7399..5f1e4a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1440,16 +1440,10 @@ impl EncState { DrmFourcc::Xbgr8888, DrmFourcc::Xrgb2101010, ] { - let is_fmt_supported = capture_formats - .iter() - .find(|p| { - p.fourcc == DrmFourcc::Xrgb8888 - && p.modifiers - .iter() - .find(|m| **m == DrmModifier::LINEAR) - .is_some() - }) - .is_some(); + let is_fmt_supported = capture_formats.iter().any(|p| { + p.fourcc == DrmFourcc::Xrgb8888 + && p.modifiers.iter().any(|m| *m == DrmModifier::LINEAR) + }); if is_fmt_supported { selected_format = Some(DmabufFormat {