Commit fce6522e authored by Ralf's avatar Ralf
Browse files

env: clone only once per loop iteration

parent 36a757df
...@@ -50,8 +50,8 @@ impl Environment { ...@@ -50,8 +50,8 @@ impl Environment {
mut handlers: Vec<EventHandler>) mut handlers: Vec<EventHandler>)
-> EventsResult { -> EventsResult {
let timeout_chan = timeout_chan(d); let timeout_chan = timeout_chan(d);
let events = self.events.clone();
loop { loop {
let events = self.events.clone();
chan_select! { chan_select! {
timeout_chan.recv() => return EventsResult::Timeout, timeout_chan.recv() => return EventsResult::Timeout,
events.recv() -> ev => { events.recv() -> ev => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment