From 6d36375f270313bdbb4264e539ce0a0f1d4e460c Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 8 Feb 2020 08:39:09 +0300 Subject: [PATCH] anvil.window_map: implement Clone for Kind --- anvil/src/window_map.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/anvil/src/window_map.rs b/anvil/src/window_map.rs index f54bda6..f98672b 100644 --- a/anvil/src/window_map.rs +++ b/anvil/src/window_map.rs @@ -19,6 +19,16 @@ pub enum Kind { Wl(ShellSurface), } +// We implement Clone manually because #[derive(..)] would require R: Clone. +impl Clone for Kind { + fn clone(&self) -> Self { + match self { + Kind::Xdg(xdg) => Kind::Xdg(xdg.clone()), + Kind::Wl(wl) => Kind::Wl(wl.clone()), + } + } +} + impl Kind where R: Role + Role + Role + 'static,