Skip to content

Commit 61672ca

Browse files
committed
Fix clippy
1 parent 151dc2e commit 61672ca

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

vm/src/hint_processor/builtin_hint_processor/builtin_hint_processor_definition.rs

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,29 +134,22 @@ use crate::{
134134
#[cfg(feature = "cairo-0-secp-hints")]
135135
use 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+
137147
pub 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

162155
impl 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(),

vm/src/hint_processor/builtin_hint_processor/secp/cairo0_hints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ mod tests {
605605
let x = BigInt::from(18446744069414584321u128); // Example x value
606606
let v = BigInt::from(1); // Example v value (must be 0 or 1 for even/odd check)
607607

608-
let constants = HashMap::new();
608+
let constants: std::collections::HashMap<K, V> = HashMap::new();
609609

610610
r1_get_point_from_x(
611611
&mut vm,

0 commit comments

Comments
 (0)