refactor(napi): JsUnknow::cast now will not move ownership
This commit is contained in:
parent
a3d8623198
commit
b1c8192d2a
1 changed files with 3 additions and 1 deletions
|
@ -610,9 +610,11 @@ impl JsUnknown {
|
|||
|
||||
#[inline]
|
||||
/// # Safety
|
||||
///
|
||||
/// This function should be called after `JsUnknown::get_type`
|
||||
///
|
||||
/// And the `V` must be match with the return value of `get_type`
|
||||
pub unsafe fn cast<V>(self) -> V
|
||||
pub unsafe fn cast<V>(&self) -> V
|
||||
where
|
||||
V: NapiValue,
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue