From a6fbb7619885551c724ee8db32777617f458ebfc Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Thu, 28 Mar 2024 22:44:57 -0700 Subject: [PATCH] cargo clippy --- core/interop/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/interop/src/lib.rs b/core/interop/src/lib.rs index a2b380e59b0..078fc8114e2 100644 --- a/core/interop/src/lib.rs +++ b/core/interop/src/lib.rs @@ -104,7 +104,7 @@ impl TryFromJsArgument for T { } /// An argument that when used in a JS function will empty the list -/// of JS arguments as JsValues. This can be used for having the +/// of JS arguments as `JsValue`s. This can be used for having the /// rest of the arguments in a function. #[derive(Debug, Clone)] pub struct JsRest(pub Vec); @@ -269,12 +269,11 @@ pub fn into_js_module() { context.run_jobs(); // Checking if the final promise didn't return an error. - if promise_result.state().as_fulfilled().is_none() { - panic!( - "module didn't execute successfully! Promise: {:?}", - promise_result.state() - ); - }; + assert!( + promise_result.state().as_fulfilled().is_some(), + "module didn't execute successfully! Promise: {:?}", + promise_result.state() + ); assert_eq!(*foo_count.borrow(), 2); assert_eq!(*bar_count.borrow(), 15);