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:
parent
8a1c5277eb
commit
73cf10e4f3
7 changed files with 49 additions and 6 deletions
|
|
@ -108,7 +108,6 @@ impl<T> EventLoop<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Proxy<T> {
|
||||
sender: mpsc::Sender<T>,
|
||||
source: CFRunLoopSourceRef,
|
||||
|
|
@ -117,6 +116,12 @@ pub struct Proxy<T> {
|
|||
unsafe impl<T> Send for Proxy<T> {}
|
||||
unsafe impl<T> Sync for Proxy<T> {}
|
||||
|
||||
impl<T> Clone for Proxy<T> {
|
||||
fn clone(&self) -> Self {
|
||||
Proxy::new(self.sender.clone())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Proxy<T> {
|
||||
fn new(sender: mpsc::Sender<T>) -> Self {
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue