avoid using manual indexing in vector

This commit is contained in:
Sergio Chouhy 2025-11-25 14:51:28 -03:00
parent 8e1c53bd4e
commit 3f636465f6

View File

@ -29,7 +29,7 @@ fn main() {
panic!("Max depth is exceeded");
}
if program_outputs[num_calls - 1].chained_call.is_some() {
if program_outputs.last().and_then(|last| last.chained_call.as_ref()).is_some() {
panic!("Call stack is incomplete");
}