diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2023-01-27 10:43:16 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 10:43:16 -0500 |
| commit | f5840bdcd360ec0bac2501f333e58e25742b1537 (patch) | |
| tree | 7eb0818d2cafa0f6824e81b6ed2cfb609830971e /cli/napi | |
| parent | 1a1faff2f67613ed0b89e1a34e6c3fd02ca6fd83 (diff) | |
chore: upgrade to Rust 1.67 (#17548)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/napi')
| -rw-r--r-- | cli/napi/async.rs | 2 | ||||
| -rw-r--r-- | cli/napi/env.rs | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/cli/napi/async.rs b/cli/napi/async.rs index 8fdb4f9d2..8cbdb2220 100644 --- a/cli/napi/async.rs +++ b/cli/napi/async.rs @@ -39,7 +39,7 @@ fn napi_cancel_async_work( /// Frees a previously allocated work object. #[napi_sym::napi_sym] fn napi_delete_async_work(_env: &mut Env, work: napi_async_work) -> Result { - let work = Box::from_raw(work); + let work = Box::from_raw(work as *mut AsyncWork); drop(work); Ok(()) diff --git a/cli/napi/env.rs b/cli/napi/env.rs index 922c64140..bdd5221e8 100644 --- a/cli/napi/env.rs +++ b/cli/napi/env.rs @@ -34,8 +34,7 @@ pub unsafe extern "C" fn napi_fatal_error( std::str::from_utf8(slice).unwrap() }; panic!( - "Fatal exception triggered by napi_fatal_error!\nLocation: {:?}\n{}", - location, message + "Fatal exception triggered by napi_fatal_error!\nLocation: {location:?}\n{message}" ); } @@ -46,10 +45,7 @@ fn napi_fatal_exception(env: *mut Env, value: napi_value) -> Result { let env: &mut Env = env.as_mut().ok_or(Error::InvalidArg)?; let value = transmute::<napi_value, v8::Local<v8::Value>>(value); let error = value.to_rust_string_lossy(&mut env.scope()); - panic!( - "Fatal exception triggered by napi_fatal_exception!\n{}", - error - ); + panic!("Fatal exception triggered by napi_fatal_exception!\n{error}"); } #[napi_sym::napi_sym] |
