summaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorRomeo Disca <romeo.disca@gmail.com>2020-08-20 10:56:53 +0200
committerRomeo Disca <romeo.disca@gmail.com>2020-08-20 10:56:53 +0200
commitffa296117d9f5820730acb83ac6d6771a61cefd8 (patch)
tree79243bfc7a00ee0651d9331a75b53ad2cbbc4797 /src/client.rs
parentfc00a175dda64108f4a26e4b846bf0ae9e2eabe3 (diff)
refactor: different things
Diffstat (limited to 'src/client.rs')
-rwxr-xr-xsrc/client.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client.rs b/src/client.rs
index a1a63f7..82781e8 100755
--- a/src/client.rs
+++ b/src/client.rs
@@ -12,11 +12,11 @@ use super::events::stream_mapper::*;
use super::commands::stream_mapper::CommandToByteMapper;
use super::commands::Command;
-type EventClosure = dyn FnMut(Event) + Sync + Send + 'static;
+type EventClosure = dyn FnMut(&Event) + Sync + Send + 'static;
type EventClosureMutex = Box<EventClosure>;
pub fn event_handler<F>(f: F) -> EventClosureMutex
- where F: FnMut(Event) + Sync + Send + 'static
+ where F: FnMut(&Event) + Sync + Send + 'static
{
Box::new(f)
}
@@ -72,7 +72,7 @@ impl FlicClient {
EventResult::Some(event) => {
let mut map = self.map.lock().await;
for ref mut f in &mut *map {
- f(event.clone());
+ f(&event);
}
}
_ => {}