@@ -45,12 +45,12 @@ pub struct FFI_Accumulator {
4545
4646 // Evaluate and return a ScalarValues as protobuf bytes
4747 pub evaluate :
48- unsafe extern "C" fn ( accumulator : & mut Self ) -> RResult < RVec < u8 > , RString > ,
48+ unsafe extern "C" fn ( accumulator : & Self ) -> RResult < RVec < u8 > , RString > ,
4949
5050 pub size : unsafe extern "C" fn ( accumulator : & Self ) -> usize ,
5151
5252 pub state :
53- unsafe extern "C" fn ( accumulator : & mut Self ) -> RResult < RVec < RVec < u8 > > , RString > ,
53+ unsafe extern "C" fn ( accumulator : & Self ) -> RResult < RVec < RVec < u8 > > , RString > ,
5454
5555 pub merge_batch : unsafe extern "C" fn (
5656 accumulator : & mut Self ,
@@ -109,9 +109,9 @@ unsafe extern "C" fn update_batch_fn_wrapper(
109109}
110110
111111unsafe extern "C" fn evaluate_fn_wrapper (
112- accumulator : & mut FFI_Accumulator ,
112+ accumulator : & FFI_Accumulator ,
113113) -> RResult < RVec < u8 > , RString > {
114- let accumulator = accumulator. inner_mut ( ) ;
114+ let accumulator = accumulator. inner ( ) ;
115115
116116 let scalar_result = rresult_return ! ( accumulator. evaluate( ) ) ;
117117 let proto_result: datafusion_proto:: protobuf:: ScalarValue =
@@ -125,9 +125,9 @@ unsafe extern "C" fn size_fn_wrapper(accumulator: &FFI_Accumulator) -> usize {
125125}
126126
127127unsafe extern "C" fn state_fn_wrapper (
128- accumulator : & mut FFI_Accumulator ,
128+ accumulator : & FFI_Accumulator ,
129129) -> RResult < RVec < RVec < u8 > > , RString > {
130- let accumulator = accumulator. inner_mut ( ) ;
130+ let accumulator = accumulator. inner ( ) ;
131131
132132 let state = rresult_return ! ( accumulator. state( ) ) ;
133133 let state = state
@@ -237,10 +237,10 @@ impl Accumulator for ForeignAccumulator {
237237 }
238238 }
239239
240- fn evaluate ( & mut self ) -> Result < ScalarValue > {
240+ fn evaluate ( & self ) -> Result < ScalarValue > {
241241 unsafe {
242242 let scalar_bytes =
243- df_result ! ( ( self . accumulator. evaluate) ( & mut self . accumulator) ) ?;
243+ df_result ! ( ( self . accumulator. evaluate) ( & self . accumulator) ) ?;
244244
245245 let proto_scalar =
246246 datafusion_proto:: protobuf:: ScalarValue :: decode ( scalar_bytes. as_ref ( ) )
@@ -254,10 +254,10 @@ impl Accumulator for ForeignAccumulator {
254254 unsafe { ( self . accumulator . size ) ( & self . accumulator ) }
255255 }
256256
257- fn state ( & mut self ) -> Result < Vec < ScalarValue > > {
257+ fn state ( & self ) -> Result < Vec < ScalarValue > > {
258258 unsafe {
259259 let state_protos =
260- df_result ! ( ( self . accumulator. state) ( & mut self . accumulator) ) ?;
260+ df_result ! ( ( self . accumulator. state) ( & self . accumulator) ) ?;
261261
262262 state_protos
263263 . into_iter ( )
0 commit comments