From c043a952a2dd5bdb447aed5a2f8e8cba4174dea7 Mon Sep 17 00:00:00 2001 From: lzubiaur Date: Mon, 20 May 2019 16:40:22 +0900 Subject: [PATCH] Fix closure example compilation errors --- guide/src/reference/passing-rust-closures-to-js.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/src/reference/passing-rust-closures-to-js.md b/guide/src/reference/passing-rust-closures-to-js.md index 839bf04d..3d4a8723 100644 --- a/guide/src/reference/passing-rust-closures-to-js.md +++ b/guide/src/reference/passing-rust-closures-to-js.md @@ -95,7 +95,7 @@ pub struct Interval { } impl Interval { - pub fn new(millis: u32, f: F) -> Interval + pub fn new(millis: u32, f: F) -> Interval where F: FnMut() { @@ -119,6 +119,6 @@ impl Drop for Interval { // Keep logging "hello" every second until the resulting `Interval` is dropped. #[wasm_bindgen] pub fn hello() -> Interval { - Interval::new(1_000, || log("hello")); + Interval::new(1_000, || log("hello")) } ```