From 591f55db515b5fd9c3d33544e34cc4d672e0658a Mon Sep 17 00:00:00 2001 From: Hana Date: Mon, 25 Sep 2023 17:03:16 +0800 Subject: [PATCH] fix: passing option as `&str` caused memory leak in `builtin:swc-loader` (#4235) fix: use `String` instead of `&str` --- crates/node_binding/src/loader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/node_binding/src/loader.rs b/crates/node_binding/src/loader.rs index 8e23fbf9024..b916afd1ba1 100644 --- a/crates/node_binding/src/loader.rs +++ b/crates/node_binding/src/loader.rs @@ -6,8 +6,8 @@ use rspack_binding_options::{run_builtin_loader as run_builtin, JsLoaderContext} #[allow(unused)] pub async fn run_builtin_loader( builtin: String, - options: Option<&str>, + options: Option, loader_context: JsLoaderContext, ) -> Result { - run_builtin(builtin, options, loader_context).await + run_builtin(builtin, options.as_deref(), loader_context).await }