From: Ian Jackson Date: Sun, 11 Oct 2020 22:05:34 +0000 (+0100) Subject: before try provide own textdecoder X-Git-Tag: otter-0.2.0~675 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3f9995a8856cc36098764164b1053bb70086c764;p=otter.git before try provide own textdecoder Signed-off-by: Ian Jackson --- 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 {