Skip to content

Commit

Permalink
style: move the InvalidArg tag check to a match guard
Browse files Browse the repository at this point in the history
Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
  • Loading branch information
dherman and kjvalencik authored Sep 10, 2024
1 parent bb4f231 commit dd1ffdf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/neon/src/types_impl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1179,11 +1179,8 @@ where
);

match status {
sys::Status::InvalidArg => {
if !sys::tag::is_function(env.to_raw(), callee) {
return cx.throw_error("not a function");
}
panic!("invalid argument");
sys::Status::InvalidArg if !sys::tag::is_function(env.to_raw(), callee) => {
return cx.throw_error("not a function");
}
sys::Status::PendingException => {
return Err(Throw::new());
Expand Down

0 comments on commit dd1ffdf

Please sign in to comment.