diff options
author | Yiyu Lin <linyiyu1992@gmail.com> | 2023-01-06 03:29:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 14:29:50 -0500 |
commit | 896dd56b7af06fea6604a5596a6ffd17e7e52e6e (patch) | |
tree | 92d3c94afe4923f1d1faccc8034a03f78b807ade /core/examples/ts_module_loader.rs | |
parent | 4e6b78cb43ece70df28281c8033b51366b110acf (diff) |
refactor(cli,core,ext,rt): remove some unnecessary `clone` or `malloc` (#17274)
Diffstat (limited to 'core/examples/ts_module_loader.rs')
-rw-r--r-- | core/examples/ts_module_loader.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/examples/ts_module_loader.rs b/core/examples/ts_module_loader.rs index 5493029a4..d9b32d5be 100644 --- a/core/examples/ts_module_loader.rs +++ b/core/examples/ts_module_loader.rs @@ -97,7 +97,7 @@ fn main() -> Result<(), Error> { println!("Usage: target/examples/debug/ts_module_loader <path_to_module>"); std::process::exit(1); } - let main_url = args[1].clone(); + let main_url = &args[1]; println!("Run {}", main_url); let mut js_runtime = JsRuntime::new(RuntimeOptions { @@ -105,7 +105,7 @@ fn main() -> Result<(), Error> { ..Default::default() }); - let main_module = resolve_path(&main_url)?; + let main_module = resolve_path(main_url)?; let future = async move { let mod_id = js_runtime.load_main_module(&main_module, None).await?; |