@@ -527,17 +527,17 @@ pub(crate) unsafe fn add_signal_with_accumulator<F>(
527
527
{
528
528
let arg_types = arg_types. iter ( ) . map ( |t| t. to_glib ( ) ) . collect :: < Vec < _ > > ( ) ;
529
529
530
- let accumulator: Box < Box < Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static > > =
531
- Box :: new ( Box :: new ( accumulator) ) ;
530
+ let accumulator: Box < F > = Box :: new ( accumulator) ;
532
531
533
- unsafe extern "C" fn accumulator_trampoline (
532
+ unsafe extern "C" fn accumulator_trampoline <
533
+ F : Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ,
534
+ > (
534
535
_ihint : * mut gobject_ffi:: GSignalInvocationHint ,
535
536
return_accu : * mut gobject_ffi:: GValue ,
536
537
handler_return : * const gobject_ffi:: GValue ,
537
538
data : ffi:: gpointer ,
538
539
) -> ffi:: gboolean {
539
- let accumulator: & & ( Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ) =
540
- & * ( data as * const & ( Fn ( & mut Value , & Value ) -> bool + Send + Sync + ' static ) ) ;
540
+ let accumulator: & F = & * ( data as * const & F ) ;
541
541
accumulator (
542
542
& mut * ( return_accu as * mut Value ) ,
543
543
& * ( handler_return as * const Value ) ,
@@ -550,7 +550,7 @@ pub(crate) unsafe fn add_signal_with_accumulator<F>(
550
550
type_,
551
551
gobject_ffi:: G_SIGNAL_RUN_LAST ,
552
552
ptr:: null_mut ( ) ,
553
- Some ( accumulator_trampoline) ,
553
+ Some ( accumulator_trampoline :: < F > ) ,
554
554
Box :: into_raw ( accumulator) as ffi:: gpointer ,
555
555
None ,
556
556
ret_type. to_glib ( ) ,
0 commit comments