mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Proposed Documentation Improvements #### Retrieved from https://yew.rs/docs/concepts/wasm-bindgen#jsvalue on 9/24/2022 `JsCast` is nicely structured so far, although I thought this section was worded strangely. > The `dyn_into` method will consume `self`, as per convention for into methods in Rust, __and the type returned is `Result<T, Self>` this means if the casting fails then the value in `Err` is so you can try again or do something else with the original type.__ I believe this edit conveys the original idea, but makes more sense to the reader: > The [`dyn_into`](https://rustwasm.github.io/wasm-bindgen/api/wasm_bindgen/trait.JsCast.html#method.dyn_into) method will consume `self`, as per convention for into methods in Rust, and the type returned is `Result<T, Self>`. This means if the casting fails then the `Self` value in `Err` is preserved. You could try again or do something else with the original type. * Update website/versioned_docs/version-0.19.0/concepts/wasm-bindgen/introduction.mdx Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com> * update latest docs Co-authored-by: Muhammad Hamza <muhammadhamza1311@gmail.com> Co-authored-by: Kaede Hoshikawa <futursolo@users.noreply.github.com>