Skip to content

Commit c449121

Browse files
committed
Remove unwrap
1 parent da8401c commit c449121

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

vm/src/hint_processor/builtin_hint_processor/builtin_hint_processor_definition.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,15 @@ impl HintProcessorLogic for BuiltinHintProcessor {
223223
);
224224
}
225225

226-
let hint_func = hint_data.f.unwrap(); // TODO: Remove unwrap
226+
let hint_func = match hint_data.f {
227+
Some(f) => f,
228+
None => {
229+
return Err(HintError::UnknownHint(
230+
// TODO: Check if we want to continue to return this error. If not, keep in mind that SimplifiedOsHintProcessor depends on this error (check execute_hint_extensive)
231+
hint_data.code.to_string().into_boxed_str(),
232+
));
233+
}
234+
};
227235

228236
hint_func(
229237
vm,

0 commit comments

Comments
 (0)