From afbab293a89e408509f1739ce4cb9a1173692e81 Mon Sep 17 00:00:00 2001 From: J H <2364004+Blu-J@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:26:59 -0600 Subject: [PATCH] Chore: remove an arc mutex that wasn't neccessary (#2462) --- libs/js_engine/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/js_engine/src/lib.rs b/libs/js_engine/src/lib.rs index d3af82651..023726d7f 100644 --- a/libs/js_engine/src/lib.rs +++ b/libs/js_engine/src/lib.rs @@ -351,16 +351,14 @@ impl JsExecutionEnvironment { startup_snapshot: Some(Snapshot::Static(SNAPSHOT_BYTES)), ..Default::default() }; - let runtime = Arc::new(Mutex::new(JsRuntime::new(runtime_options))); + let mut runtime = JsRuntime::new(runtime_options); let future = async move { let mod_id = runtime - .lock() - .await .load_main_module(&"file:///loadModule.js".parse().unwrap(), None) .await?; - let evaluated = runtime.lock().await.mod_evaluate(mod_id); - let res = runtime.lock().await.run_event_loop(false).await; + let evaluated = runtime.mod_evaluate(mod_id); + let res = runtime.run_event_loop(false).await; res?; evaluated.await??; Ok::<_, AnyError>(())