From 273a6307f797dbab70a10b18cea7cfea88f284d7 Mon Sep 17 00:00:00 2001 From: Syrus Date: Wed, 15 Jan 2020 14:04:08 +0100 Subject: [PATCH] =?UTF-8?q?Use=20&=E2=80=99static=20str=20for=20backend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/middleware-common-tests/src/lib.rs | 4 ++-- lib/runtime-core/src/state.rs | 2 +- src/bin/wasmer.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/middleware-common-tests/src/lib.rs b/lib/middleware-common-tests/src/lib.rs index d3beeb8f7..20d69bb3d 100644 --- a/lib/middleware-common-tests/src/lib.rs +++ b/lib/middleware-common-tests/src/lib.rs @@ -110,7 +110,7 @@ mod tests { baseline: true, msm: msm, base: instance.module.runnable_module.get_code().unwrap().as_ptr() as usize, - backend: MCG::backend_id().to_string(), + backend: MCG::backend_id(), runnable_module: instance.module.runnable_module.clone(), }); true @@ -152,7 +152,7 @@ mod tests { baseline: true, msm: msm, base: instance.module.runnable_module.get_code().unwrap().as_ptr() as usize, - backend: MCG::backend_id().to_string(), + backend: MCG::backend_id(), runnable_module: instance.module.runnable_module.clone(), }); true diff --git a/lib/runtime-core/src/state.rs b/lib/runtime-core/src/state.rs index 870e955a5..f7e9cc791 100644 --- a/lib/runtime-core/src/state.rs +++ b/lib/runtime-core/src/state.rs @@ -186,7 +186,7 @@ pub struct CodeVersion { pub base: usize, /// The backend used to compile this module. - pub backend: String, + pub backend: &'static str, /// `RunnableModule` for this code version. pub runnable_module: Arc>, diff --git a/src/bin/wasmer.rs b/src/bin/wasmer.rs index 339b0a1bb..7c4c04161 100644 --- a/src/bin/wasmer.rs +++ b/src/bin/wasmer.rs @@ -486,7 +486,7 @@ fn execute_wasi( baseline: true, msm: msm, base: instance.module.runnable_module.get_code().unwrap().as_ptr() as usize, - backend: options.backend.to_string().to_owned(), + backend: options.backend.to_string(), runnable_module: instance.module.runnable_module.clone(), }); true