Skip to content

Conversation

fitzgen
Copy link
Contributor

@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
Contributor Author

fitzgen commented Jan 31, 2019

@alexcrichton
Copy link
Contributor

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

@alexcrichton alexcrichton merged commit 9f00664 into wasm-bindgen: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

2 participants