Skip to content

Commit a37ea0e

Browse files
committed
Fix ProcVoidMethod/ProcVoidFunction helpers
1 parent 7de955d commit a37ea0e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/ext.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,17 @@ mod proc_void_method_ext {
303303
use unity2::{FromIlInstance, IlInstance, IntPtr, MethodInfo, OptionalMethod};
304304

305305
pub trait ProcVoidMethodExt: Sized {
306-
fn from_fn(
306+
fn from_fn<T: crate::app::procinst::IProcInst>(
307307
target: IlInstance,
308-
callback: extern "C" fn(IlInstance, OptionalMethod),
308+
callback: extern "C" fn(T, OptionalMethod),
309309
) -> Option<Self>;
310310
fn from_raw_parts(target: IlInstance, method_info: &'static MethodInfo) -> Option<Self>;
311311
}
312312

313313
impl ProcVoidMethodExt for ProcVoidMethod {
314-
fn from_fn(
314+
fn from_fn<T: crate::app::procinst::IProcInst>(
315315
target: IlInstance,
316-
callback: extern "C" fn(IlInstance, OptionalMethod),
316+
callback: extern "C" fn(T, OptionalMethod),
317317
) -> Option<Self> {
318318
let intptr = super::method_info_intptr(callback as *mut u8, 0);
319319
Some(ProcVoidMethod::new(
@@ -345,18 +345,18 @@ mod proc_void_function_ext {
345345
use unity2::{FromIlInstance, IlInstance, OptionalMethod};
346346

347347
pub trait ProcVoidFunctionExt: Sized {
348-
fn from_fn(
348+
fn from_fn<T: crate::app::procinst::IProcInst, U: crate::app::procinst::IProcInst>(
349349
target: IlInstance,
350-
callback: extern "C" fn(crate::app::procinst::ProcInst, OptionalMethod),
350+
callback: extern "C" fn(T, U, OptionalMethod),
351351
) -> Option<Self>;
352352
}
353353

354354
impl ProcVoidFunctionExt for ProcVoidFunction {
355-
fn from_fn(
355+
fn from_fn<T: crate::app::procinst::IProcInst, U: crate::app::procinst::IProcInst>(
356356
target: IlInstance,
357-
callback: extern "C" fn(crate::app::procinst::ProcInst, OptionalMethod),
357+
callback: extern "C" fn(T, U, OptionalMethod),
358358
) -> Option<Self> {
359-
let intptr = super::method_info_intptr(callback as *mut u8, 1);
359+
let intptr = super::method_info_intptr(callback as *mut u8, 2);
360360
Some(ProcVoidFunction::new(
361361
<Object as FromIlInstance>::from_il_instance(target),
362362
intptr,

0 commit comments

Comments
 (0)