@@ -134,29 +134,22 @@ use crate::{
134134#[ cfg( feature = "cairo-0-secp-hints" ) ]
135135use crate :: hint_processor:: builtin_hint_processor:: secp:: cairo0_hints;
136136
137+ type HintFuncPointer = Option <
138+ fn (
139+ & mut VirtualMachine ,
140+ & mut ExecutionScopes ,
141+ & HashMap < String , HintReference > ,
142+ & ApTracking ,
143+ & HashMap < String , Felt252 > ,
144+ ) -> Result < ( ) , HintError > ,
145+ > ;
146+
137147pub struct HintProcessorData {
138148 pub code : String ,
139149 pub ap_tracking : ApTracking ,
140150 pub ids_data : HashMap < String , HintReference > ,
141151 pub constants : Rc < HashMap < String , Felt252 > > ,
142- // pub f: Box<
143- // dyn FnMut(
144- // &mut VirtualMachine,
145- // &mut ExecutionScopes,
146- // &HashMap<String, HintReference>,
147- // &ApTracking,
148- // &HashMap<String, Felt252>,
149- // ),
150- // >,
151- pub f : Option <
152- fn (
153- & mut VirtualMachine ,
154- & mut ExecutionScopes ,
155- & HashMap < String , HintReference > ,
156- & ApTracking ,
157- & HashMap < String , Felt252 > ,
158- ) -> Result < ( ) , HintError > ,
159- > ,
152+ pub f : HintFuncPointer ,
160153}
161154
162155impl HintProcessorData {
@@ -237,7 +230,7 @@ impl HintProcessorLogic for BuiltinHintProcessor {
237230 exec_scopes,
238231 & hint_data. ids_data ,
239232 & hint_data. ap_tracking ,
240- & constants,
233+ constants,
241234 )
242235 }
243236
@@ -257,7 +250,7 @@ impl HintProcessorLogic for BuiltinHintProcessor {
257250 ) -> Result < Box < dyn Any > , crate :: vm:: errors:: vm_errors:: VirtualMachineError > {
258251 let ids_data = get_ids_data ( reference_ids, references) ?;
259252
260- if let Some ( _ ) = self . extra_hints . get ( hint_code) {
253+ if self . extra_hints . get ( hint_code) . is_some ( ) {
261254 // TODO: This is to handle the extra_hints. Handle this case nicely
262255 return Ok ( any_box ! ( HintProcessorData {
263256 code: hint_code. to_string( ) ,
0 commit comments