Skip to content

Commit 4dc3895

Browse files
committed
gloo-timers: don't consume callback in Interval closure - otherwise interval only works on first callback and fails after that
1 parent 5cf8eed commit 4dc3895

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/timers/src/callback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Interval {
152152
{
153153
let mut callback = Some(callback);
154154
let closure = Closure::wrap(Box::new(move || {
155-
let mut callback = callback.take().unwrap_throw();
155+
let callback = callback.as_mut().take().unwrap_throw();
156156
callback();
157157
}) as Box<FnMut()>);
158158

0 commit comments

Comments
 (0)