From: Ian Jackson Date: Mon, 12 Oct 2020 00:15:49 +0000 (+0100) Subject: require Copy X-Git-Tag: otter-0.2.0~664 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=25abad0675de9f3e85e6abad3706e7c6ee2f1cd4;p=otter.git require Copy Avoids us impl'd for nontrivial types Signed-off-by: Ian Jackson --- diff --git a/wasm/wasm.rs b/wasm/wasm.rs index 7bea8ecf..650cbf6d 100644 --- a/wasm/wasm.rs +++ b/wasm/wasm.rs @@ -15,7 +15,7 @@ trait WasmError { fn e(self) -> JsValue; } -impl WasmError for E where E: Display { +impl WasmError for E where E: Display+Copy { fn e(self) -> JsValue { let s = format!("{}", self); JsValue::from_str(&s) @@ -26,7 +26,7 @@ trait WasmResult { fn e(self) -> Result; } -impl WasmResult for Result { +impl WasmResult for Result { fn e(self) -> Result { self.map_err(WasmError::e) } }