From 04238c38ab1ebda50d42b1f30716cc21616f22f7 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 6 Jul 2020 23:56:55 +0800 Subject: [PATCH] style(napi): typo adjust --- napi/src/env.rs | 12 ++++++------ test_module/yarn.lock | 4 ---- 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 test_module/yarn.lock diff --git a/napi/src/env.rs b/napi/src/env.rs index 4201398d..14047573 100644 --- a/napi/src/env.rs +++ b/napi/src/env.rs @@ -197,9 +197,9 @@ impl Env { }; check_status(status)?; let mut changed = 0; - let ajust_external_memory_status = + let adjust_external_memory_status = unsafe { sys::napi_adjust_external_memory(self.0, length as i64, &mut changed) }; - check_status(ajust_external_memory_status)?; + check_status(adjust_external_memory_status)?; mem::forget(data); let mut buffer = JsBuffer::from_raw_unchecked(self.0, raw_value); buffer.data = data_ptr as *const u8; @@ -239,9 +239,9 @@ impl Env { }; check_status(status)?; let mut changed = 0; - let ajust_external_memory_status = + let adjust_external_memory_status = unsafe { sys::napi_adjust_external_memory(self.0, length as i64, &mut changed) }; - check_status(ajust_external_memory_status)?; + check_status(adjust_external_memory_status)?; mem::forget(data); let mut array_buffer = JsArrayBuffer::from_raw_unchecked(self.0, raw_value); array_buffer.data = data_ptr as *const u8; @@ -541,9 +541,9 @@ unsafe extern "C" fn drop_buffer(env: sys::napi_env, finalize_data: *mut c_void, let length = *length as usize; let _ = Vec::from_raw_parts(finalize_data as *mut u8, length, length); let mut changed = 0; - let ajust_external_memory_status = + let adjust_external_memory_status = sys::napi_adjust_external_memory(env, -(length as i64), &mut changed); - debug_assert!(Status::from(ajust_external_memory_status) == Status::Ok); + debug_assert!(Status::from(adjust_external_memory_status) == Status::Ok); } unsafe extern "C" fn raw_finalize( diff --git a/test_module/yarn.lock b/test_module/yarn.lock deleted file mode 100644 index fb57ccd1..00000000 --- a/test_module/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - -