From eba55cb1da8044b33dbff273403f4fd5bf21997d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 3 Oct 2017 09:31:42 -0700 Subject: [PATCH] Make the "wat2wasm" error message not panic. --- cranelift/src/wasm.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 7f18130d67..dc9c6ba188 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -139,8 +139,7 @@ fn handle_module( return Err(String::from("wat2wasm not found")); } else { return Err(String::from(e.description())); - }) - .unwrap(); + })?; read_wasm_file(file_path).map_err(|err| { String::from(err.description()) })?