From 77929a525a8281ae06215ac8c1293b7ba83ef0af Mon Sep 17 00:00:00 2001 From: David Herman Date: Tue, 26 Nov 2024 09:47:58 -0800 Subject: [PATCH] debug_assert_eq! on delete_async_work for consistency --- crates/neon/src/sys/async_work.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/neon/src/sys/async_work.rs b/crates/neon/src/sys/async_work.rs index 338319f37..e834576c6 100644 --- a/crates/neon/src/sys/async_work.rs +++ b/crates/neon/src/sys/async_work.rs @@ -150,9 +150,7 @@ unsafe extern "C" fn call_complete(env: Env, status: napi::Status, data .. } = *Box::>::from_raw(data.cast()); - if napi::delete_async_work(env, work).is_err() { - panic!("Failed to delete async work"); - } + debug_assert_eq!(napi::delete_async_work(env, work), Ok(())); BOUNDARY.catch_failure(env, None, move |env| { // `unwrap` is okay because `call_complete` should be called exactly once