Skip to content

Commit

Permalink
ManagedType - forget_into_handle in to ManagedVecItem impl for manage…
Browse files Browse the repository at this point in the history
…d types
  • Loading branch information
andrei-marinica committed Nov 18, 2024
1 parent 28d5b91 commit cc250e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions framework/base/src/types/managed/wrapped/managed_vec_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ macro_rules! impl_managed_type {
}

fn into_byte_writer<R, Writer: FnMut(&[u8]) -> R>(self, writer: Writer) -> R {
<$ty<M> as ManagedType<M>>::OwnHandle::into_byte_writer(self.get_handle(), writer)
let handle = unsafe { self.forget_into_handle() };
<$ty<M> as ManagedType<M>>::OwnHandle::into_byte_writer(handle, writer)
}
}
};
Expand Down Expand Up @@ -266,7 +267,8 @@ where
}

fn into_byte_writer<R, Writer: FnMut(&[u8]) -> R>(self, writer: Writer) -> R {
<M::ManagedBufferHandle as ManagedVecItem>::into_byte_writer(self.get_handle(), writer)
let handle = unsafe { self.forget_into_handle() };
<M::ManagedBufferHandle as ManagedVecItem>::into_byte_writer(handle, writer)
}
}

Expand Down

0 comments on commit cc250e1

Please sign in to comment.