summaryrefslogtreecommitdiff
path: root/ext/napi/lib.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-06 03:29:50 +0800
committerGitHub <noreply@github.com>2023-01-05 14:29:50 -0500
commit896dd56b7af06fea6604a5596a6ffd17e7e52e6e (patch)
tree92d3c94afe4923f1d1faccc8034a03f78b807ade /ext/napi/lib.rs
parent4e6b78cb43ece70df28281c8033b51366b110acf (diff)
refactor(cli,core,ext,rt): remove some unnecessary `clone` or `malloc` (#17274)
Diffstat (limited to 'ext/napi/lib.rs')
-rw-r--r--ext/napi/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs
index 24d7c7c11..b281fb9f2 100644
--- a/ext/napi/lib.rs
+++ b/ext/napi/lib.rs
@@ -529,7 +529,7 @@ where
let exports = v8::Object::new(scope);
let mut env_shared = EnvShared::new(napi_wrap);
- let cstr = CString::new(path.clone()).unwrap();
+ let cstr = CString::new(&*path).unwrap();
env_shared.filename = cstr.as_ptr();
std::mem::forget(cstr);