Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions turshi/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{

use crate::{helper::*, word::CairoWord};
use ark_ff::Field;
use core::iter::repeat;
use core::iter::repeat_n;

/// This data structure stores the memory of the program
pub struct CairoMemory<F> {
Expand Down Expand Up @@ -85,7 +85,7 @@ impl<F: Field> CairoMemory<F> {
// you will need to extend the vector with enough spaces (taking into account that
// vectors start by index 0, the 0 address is dummy, and size starts in 1)
if let Some(additional) = addr.checked_sub(self.len() - 1) {
self.data.extend(repeat(None).take(additional as usize));
self.data.extend(repeat_n(None, additional as usize));
}
}

Expand Down
4 changes: 2 additions & 2 deletions turshi/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ pub struct CairoStep<'a, F> {

impl<'a, F: Field> CairoStep<'a, F> {
/// Creates a new Cairo execution step from a step index, a Cairo word, and current pointers
pub fn new(mem: &mut CairoMemory<F>, ptrs: CairoState<F>) -> CairoStep<F> {
pub fn new(mem: &mut CairoMemory<F>, ptrs: CairoState<F>) -> CairoStep<'_, F> {
CairoStep {
mem,
curr: ptrs,
Expand Down Expand Up @@ -503,7 +503,7 @@ pub struct CairoProgram<'a, F> {

impl<'a, F: Field> CairoProgram<'a, F> {
/// Creates a Cairo execution from the public information (memory and initial pointers)
pub fn new(mem: &mut CairoMemory<F>, pc: u64) -> CairoProgram<F> {
pub fn new(mem: &mut CairoMemory<F>, pc: u64) -> CairoProgram<'_, F> {
let ap = mem.len();
let mut prog = CairoProgram {
steps: F::zero(),
Expand Down
Loading