Skip to content
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

Add the UnwrapThrowExt<T> trait #1219

Merged
merged 1 commit into from
Feb 1, 2019

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jan 31, 2019

An extension trait for Option<T> and Result<T, E> for unwraping the T value, or throwing a JS error if it is not available.

These methods should have a smaller code size footprint than the normal Option::unwrap and Option::expect methods, but they are specific to working with wasm and JS.

On non-wasm32 targets, defaults to the normal unwrap/expect calls.

An extension trait for `Option<T>` and `Result<T, E>` for unwraping the `T`
value, or throwing a JS error if it is not available.

These methods should have a smaller code size footprint than the normal
`Option::unwrap` and `Option::expect` methods, but they are specific to
working with wasm and JS.

On non-wasm32 targets, defaults to the normal unwrap/expect calls.
@fitzgen fitzgen requested a review from alexcrichton January 31, 2019 21:27
@fitzgen
Copy link
Member Author

fitzgen commented Jan 31, 2019

@alexcrichton any idea what's up with the gc tests? https://travis-ci.com/rustwasm/wasm-bindgen/jobs/174516547#L748-L784

@alexcrichton
Copy link
Contributor

Oh that's paritytech/parity-wasm#264, nothing to worry about there!

@alexcrichton alexcrichton merged commit 9f00664 into rustwasm:master Feb 1, 2019
@fitzgen fitzgen deleted the UnwrapThrowExt branch February 1, 2019 21:19
@fitzgen fitzgen added the TWiRaWA Nominate this PR for inclusion in the next issue of This Week in Rust and WebAssembly label Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TWiRaWA Nominate this PR for inclusion in the next issue of This Week in Rust and WebAssembly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants