anvil.window_map: implement Clone for Kind

This commit is contained in:
Ivan Molodetskikh 2020-02-08 08:39:09 +03:00
parent 33a9e242ed
commit 6d36375f27
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,16 @@ pub enum Kind<R> {
Wl(ShellSurface<R>), Wl(ShellSurface<R>),
} }
// We implement Clone manually because #[derive(..)] would require R: Clone.
impl<R> Clone for Kind<R> {
fn clone(&self) -> Self {
match self {
Kind::Xdg(xdg) => Kind::Xdg(xdg.clone()),
Kind::Wl(wl) => Kind::Wl(wl.clone()),
}
}
}
impl<R> Kind<R> impl<R> Kind<R>
where where
R: Role<SubsurfaceRole> + Role<XdgSurfaceRole> + Role<ShellSurfaceRole> + 'static, R: Role<SubsurfaceRole> + Role<XdgSurfaceRole> + Role<ShellSurfaceRole> + 'static,