Skip to content

Commit

Permalink
Get rid of double-borrow
Browse files Browse the repository at this point in the history
  • Loading branch information
aapoalas committed Oct 9, 2022
1 parent d26bcaa commit 7ef6773
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ops/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ fn codegen_fast_impl(
} else {
quote! {
let isolate = {
let mut isolate_ptr = ::std::cell::RefCell::borrow(&ctx.state).isolate_ptr;
let isolate_ptr = ::std::cell::RefCell::borrow(&ctx.state).isolate_ptr;
if isolate_ptr.is_null() {
opts.fallback = true;
return Default::default();
Expand Down Expand Up @@ -585,9 +585,11 @@ fn codegen_v8_sync(
{
let mut op_state = ::std::cell::RefCell::borrow_mut(&ctx.state);
if let Some(err) = op_state.last_fast_op_error.take() {
let get_error_class_fn = op_state.get_error_class_fn;
::std::mem::drop(op_state);
let exception = #core::error::to_v8_error(
scope,
op_state.get_error_class_fn,
get_error_class_fn,
&err
);
scope.throw_exception(exception);
Expand Down

0 comments on commit 7ef6773

Please # to comment.