From 25abad0675de9f3e85e6abad3706e7c6ee2f1cd4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 12 Oct 2020 01:15:49 +0100 Subject: [PATCH] require Copy Avoids us impl'd for nontrivial types Signed-off-by: Ian Jackson --- wasm/wasm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) } } -- 2.30.2