diff --git a/napi/src/js_values/mod.rs b/napi/src/js_values/mod.rs index c2eb7d63..ad700ba0 100644 --- a/napi/src/js_values/mod.rs +++ b/napi/src/js_values/mod.rs @@ -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(self) -> V + pub unsafe fn cast(&self) -> V where V: NapiValue, {