style(napi): typo adjust

This commit is contained in:
LongYinan 2020-07-06 23:56:55 +08:00 committed by LongYinan
parent f4a331cfe2
commit 04238c38ab
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881
2 changed files with 6 additions and 10 deletions

View file

@ -197,9 +197,9 @@ impl Env {
}; };
check_status(status)?; check_status(status)?;
let mut changed = 0; 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) }; 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); mem::forget(data);
let mut buffer = JsBuffer::from_raw_unchecked(self.0, raw_value); let mut buffer = JsBuffer::from_raw_unchecked(self.0, raw_value);
buffer.data = data_ptr as *const u8; buffer.data = data_ptr as *const u8;
@ -239,9 +239,9 @@ impl Env {
}; };
check_status(status)?; check_status(status)?;
let mut changed = 0; 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) }; 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); mem::forget(data);
let mut array_buffer = JsArrayBuffer::from_raw_unchecked(self.0, raw_value); let mut array_buffer = JsArrayBuffer::from_raw_unchecked(self.0, raw_value);
array_buffer.data = data_ptr as *const u8; 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 length = *length as usize;
let _ = Vec::from_raw_parts(finalize_data as *mut u8, length, length); let _ = Vec::from_raw_parts(finalize_data as *mut u8, length, length);
let mut changed = 0; 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); 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<T>( unsafe extern "C" fn raw_finalize<T>(

View file

@ -1,4 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1