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

@ -66,11 +66,18 @@ pub struct EventLoop<T: 'static> {
target: Rc<RootELW<T>>,
}
#[derive(Clone)]
pub struct EventLoopProxy<T: 'static> {
user_sender: ::calloop::channel::Sender<T>,
}
impl<T: 'static> Clone for EventLoopProxy<T> {
fn clone(&self) -> Self {
EventLoopProxy {
user_sender: self.user_sender.clone(),
}
}
}
impl<T: 'static> EventLoop<T> {
pub fn new(xconn: Arc<XConnection>) -> EventLoop<T> {
let root = unsafe { (xconn.xlib.XDefaultRootWindow)(xconn.display) };