refactor(napi): JsUnknow::cast now will not move ownership

This commit is contained in:
LongYinan 2020-12-25 12:02:24 +08:00
parent a3d8623198
commit b1c8192d2a
No known key found for this signature in database
GPG key ID: A3FFE134A3E20881

View file

@ -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,
{