@@ -36,7 +36,7 @@ use std::sync::{Arc, LazyLock};
3636use std:: time:: Instant ;
3737use v8:: {
3838 Context , ContextOptions , ContextScope , Function , FunctionCallbackArguments , HandleScope , Isolate , IsolateHandle ,
39- Local , Object , OwnedIsolate , Value ,
39+ Local , Object , OwnedIsolate , ReturnValue , Value ,
4040} ;
4141
4242mod de;
@@ -847,16 +847,16 @@ type FnRet<'s> = ExcResult<Local<'s, Value>>;
847847fn register_host_fun (
848848 scope : & mut HandleScope < ' _ > ,
849849 name : & str ,
850- fun : impl for < ' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > ) -> FnRet < ' s > ,
850+ fun : impl Copy + for <' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > ) -> FnRet < ' s > ,
851851) {
852852 let name = v8_interned_string ( scope, name) . into ( ) ;
853- let fun = Function :: new ( scope, & adapt_fun ( fun) ) . unwrap ( ) . into ( ) ;
853+ let fun = Function :: new ( scope, adapt_fun ( fun) ) . unwrap ( ) . into ( ) ;
854854 global ( scope) . set ( scope, name, fun) . unwrap ( ) ;
855855}
856856
857857fn adapt_fun (
858- fun : impl for < ' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > ) -> FnRet < ' s > ,
859- ) -> impl for < ' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > , v8 :: ReturnValue < Value > ) {
858+ fun : impl Copy + for <' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > ) -> FnRet < ' s > ,
859+ ) -> impl Copy + for <' s > Fn ( & mut HandleScope < ' s > , FunctionCallbackArguments < ' s > , ReturnValue < Value > ) {
860860 move |scope, args, mut rv| {
861861 if let Ok ( value) = fun ( scope, args) {
862862 rv. set ( value) ;
0 commit comments