1 2 3 4 5 6 7 8 9 10 11 12 13
use extend::ext; use wasm_bindgen::JsValue; #[ext] pub impl<T> Result<T, JsValue> { /// Map a `Result<T,JsValue>` to an [`anyhow::Result`]. fn anyhow(self) -> anyhow::Result<T> { match self { Ok(v) => Ok(v), Err(e) => Err(anyhow::anyhow!("{:?}", e)), } } }