From 96389fa9995f0ac06072603e601c90e50119e989 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 16 Nov 2023 13:38:37 -0800 Subject: [PATCH] Remove manual `Hash` impl Added support for this to wayland-rs. --- src/wayland/capture.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/wayland/capture.rs b/src/wayland/capture.rs index 5b02071..5361b3f 100644 --- a/src/wayland/capture.rs +++ b/src/wayland/capture.rs @@ -15,7 +15,7 @@ use std::sync::{ use super::{AppData, Buffer}; -#[derive(Clone, PartialEq, Eq)] +#[derive(Clone, Hash, PartialEq, Eq)] pub enum CaptureSource { Toplevel(zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1), Workspace( @@ -24,20 +24,6 @@ pub enum CaptureSource { ), } -#[allow(clippy::derive_hash_xor_eq)] -impl std::hash::Hash for CaptureSource { - fn hash(&self, state: &mut H) - where - H: std::hash::Hasher, - { - match self { - Self::Toplevel(handle) => handle.id(), - Self::Workspace(handle, _output) => handle.id(), - } - .hash(state) - } -} - #[derive(Clone, Debug, Default)] pub struct CaptureFilter { // TODO: Use `WlOutput` when one Wayland connection is used