From 3f9995a8856cc36098764164b1053bb70086c764 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 11 Oct 2020 23:05:34 +0100 Subject: [PATCH] before try provide own textdecoder Signed-off-by: Ian Jackson --- wasm/wasm.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wasm/wasm.rs b/wasm/wasm.rs index 8f431511..e6cf20da 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -30,20 +30,19 @@ impl WasmResult for Result { #[throws(JsValue)] #[wasm_bindgen] pub fn check(packed: &JsValue) { - let s = packed.as_string().ok_or_else( - ||format!("packed Z coordinate wrong JS type (not a string): {:?}", - packed) + let s = packed.as_string().ok_or( + "packed Z coordinate wrong JS type (not a string)", ).e()?; ZCoord::check_str(&s).ok_or(zcoord::ParseError).e()?; } const X : &'static str = "invalid value passed to wasm"; - +/* #[throws(JsValue)] #[wasm_bindgen] pub fn mutable(s: String) -> ZCoordIterator { ZCoordIterator(ZCoord::from_str(&s).ok_or(X)?.clone_mut()) -} +}*/ #[wasm_bindgen] impl ZCoordIterator { -- 2.30.2