"JS<T>::from_raw" should accept "*T" instead of "*mut T"

This commit is contained in:
Tetsuharu OHZEKI 2014-05-30 05:38:17 +09:00
parent e511c04935
commit 106627e6eb
5 changed files with 13 additions and 13 deletions

View file

@ -84,10 +84,10 @@ pub unsafe fn dom_object_slot(obj: *mut JSObject) -> u32 {
}
}
pub unsafe fn unwrap<T>(obj: *mut JSObject) -> *mut T {
pub unsafe fn unwrap<T>(obj: *mut JSObject) -> *T {
let slot = dom_object_slot(obj);
let val = JS_GetReservedSlot(obj, slot);
val.to_private() as *mut T
val.to_private() as *T
}
pub unsafe fn get_dom_class(obj: *mut JSObject) -> Result<DOMClass, ()> {