Skip to content

Commit

Permalink
gloo-timers: don't consume callback in Interval closure - otherwise i…
Browse files Browse the repository at this point in the history
…nterval only works on first callback and fails after that
  • Loading branch information
samcday committed Mar 28, 2019
1 parent 5cf8eed commit 4dc3895
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/timers/src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Interval {
{
let mut callback = Some(callback);
let closure = Closure::wrap(Box::new(move || {
let mut callback = callback.take().unwrap_throw();
let callback = callback.as_mut().take().unwrap_throw();
callback();
}) as Box<FnMut()>);

Expand Down

0 comments on commit 4dc3895

Please sign in to comment.