@@ -41,7 +41,7 @@ pub struct GuestFunctionDefinition {
4141 pub function_pointer : usize ,
4242}
4343
44- /// Trait for functions that can be converted to a `fn(& FunctionCall) -> Result<Vec<u8>>`
44+ /// Trait for functions that can be converted to a `fn(FunctionCall) -> Result<Vec<u8>>`
4545#[ doc( hidden) ]
4646pub trait IntoGuestFunction < Output , Args >
4747where
5353 #[ doc( hidden) ]
5454 const ASSERT_ZERO_SIZED : ( ) ;
5555
56- /// Convert the function into a `fn(& FunctionCall) -> Result<Vec<u8>>`
57- fn into_guest_function ( self ) -> fn ( & FunctionCall ) -> Result < Vec < u8 > > ;
56+ /// Convert the function into a `fn(FunctionCall) -> Result<Vec<u8>>`
57+ fn into_guest_function ( self ) -> fn ( FunctionCall ) -> Result < Vec < u8 > > ;
5858}
5959
6060/// Trait for functions that can be converted to a `GuestFunctionDefinition`
@@ -124,14 +124,14 @@ macro_rules! impl_host_function {
124124 assert!( core:: mem:: size_of:: <Self >( ) == 0 )
125125 } ;
126126
127- fn into_guest_function( self ) -> fn ( & FunctionCall ) -> Result <Vec <u8 >> {
128- |fc: & FunctionCall | {
127+ fn into_guest_function( self ) -> fn ( FunctionCall ) -> Result <Vec <u8 >> {
128+ |fc: FunctionCall | {
129129 // SAFETY: This is safe because:
130130 // 1. F is zero-sized (enforced by the ASSERT_ZERO_SIZED const).
131131 // 2. F has no Drop impl (enforced by the Copy bound).
132132 // Therefore, creating an instance of F is safe.
133133 let this = unsafe { core:: mem:: zeroed:: <F >( ) } ;
134- let params = fc. parameters. clone ( ) . unwrap_or_default( ) ;
134+ let params = fc. parameters. unwrap_or_default( ) ;
135135 let params = <( $( $P, ) * ) as ParameterTuple >:: from_value( params) ?;
136136 let result = Function :: <R :: ReturnType , ( $( $P, ) * ) , HyperlightGuestError >:: call( & this, params) ?;
137137 Ok ( into_flatbuffer_result( result. into_value( ) ) )
0 commit comments