Do not require T: Clone for EventLoopProxy<T>: Clone (#1086)

* Do not require `T: Clone` for `EventLoopProxy<T>: Clone`

* Update `CHANGELOG.md`

* Remove the conflicting `Clone` impl

* Fix match statement
This commit is contained in:
YVT 2019-08-06 05:51:42 +09:00 committed by Osspial
parent 8a1c5277eb
commit 73cf10e4f3
7 changed files with 49 additions and 6 deletions

View file

@ -479,12 +479,20 @@ pub enum EventLoop<T: 'static> {
X(x11::EventLoop<T>),
}
#[derive(Clone)]
pub enum EventLoopProxy<T: 'static> {
X(x11::EventLoopProxy<T>),
Wayland(wayland::EventLoopProxy<T>),
}
impl<T: 'static> Clone for EventLoopProxy<T> {
fn clone(&self) -> Self {
match self {
EventLoopProxy::X(proxy) => EventLoopProxy::X(proxy.clone()),
EventLoopProxy::Wayland(proxy) => EventLoopProxy::Wayland(proxy.clone()),
}
}
}
impl<T: 'static> EventLoop<T> {
pub fn new() -> EventLoop<T> {
if let Ok(env_var) = env::var(BACKEND_PREFERENCE_ENV_VAR) {