Supporting unsafe functions for deno_bindgen would be so great as it'll eliminate the need to use an unsafe block when using pointers which is pretty annoying...
Now
#[deno_bindgen]
pub fn some_method(ptr: usize) {
unsafe {
let this=(ptr as *const SomeStruct).as_ref().unwrap();
this.some_method();
}
}
Better one
#[deno_bindgen]
pub unsafe fn some_method(ptr: usize) {
let this=(ptr as *const SomeStruct).as_ref().unwrap();
this.some_method();
}
Supporting unsafe functions for
deno_bindgen
would be so great as it'll eliminate the need to use anunsafe
block when using pointers which is pretty annoying...Now
Better one