Skip to content

Commit

Permalink
Fix example code in guide (#3813)
Browse files Browse the repository at this point in the history
  • Loading branch information
akiomik authored Jan 26, 2024
1 parent c194515 commit fb518d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guide/src/reference/passing-rust-closures-to-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ as arguments and returns.
#[wasm_bindgen]
extern "C" {
fn setInterval(closure: &Closure<dyn FnMut()>, millis: u32) -> f64;
fn cancelInterval(token: f64);
fn clearInterval(token: f64);

#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
Expand All @@ -109,10 +109,10 @@ impl Interval {
}
}

// When the Interval is destroyed, cancel its `setInterval` timer.
// When the Interval is destroyed, clear its `setInterval` timer.
impl Drop for Interval {
fn drop(&mut self) {
cancelInterval(self.token);
clearInterval(self.token);
}
}

Expand Down

0 comments on commit fb518d3

Please sign in to comment.