Skip to content

Tweak more Closure docs #848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2018

Conversation

alexcrichton
Copy link
Contributor

Show off usage of the stable Closure::wrap instead of Closure::new and
additionally add an explicit example of using it with web_sys.

Closes #843

src/closure.rs Outdated
@@ -55,9 +57,9 @@ use throw;
/// pub fn run() -> ClosureHandle {
/// // First up we use `Closure::new` to wrap up a Rust closure and create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the comment needs a tweak

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks!

///
/// let window = web_sys::window().unwrap();
/// window.set_timeout_with_callback_and_timeout_and_arguments_0(
/// // Note this method call, which uses `as_ref()` to get a `JsValue`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Show off usage of the stable `Closure::wrap` instead of `Closure::new` and
additionally add an explicit example of using it with `web_sys`.

Closes rustwasm#843
@alexcrichton alexcrichton merged commit a7cda70 into rustwasm:master Sep 18, 2018
@alexcrichton alexcrichton deleted the closure-docs-again branch September 18, 2018 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants