pub fn update_segment_history(&mut self, current_split_index: usize) {
        let mut last_split_time = Time::zero();

        let segments = self.segments.iter_mut().take(current_split_index);
        let index = self
            .attempt_history
            .last()
            .expect("There is no attempt in the Attempt History.")
            .index();

        for segment in segments {
            let split_time = segment.split_time();
            let segment_time = Time::op(split_time, last_split_time, |a, b| a - b);
            segment.segment_history_mut().insert(index, segment_time);
            if let Some(time) = split_time.real_time {
                last_split_time.real_time = Some(time);
            }
            if let Some(time) = split_time.game_time {
                last_split_time.game_time = Some(time);
            }
        }
    }
/// Updates the Segment History by adding the split times of the most recent
/// attempt up to the provided current split index to the Segment History.
///
/// # Panics
///
/// This panics if there is no attempt in the Attempt History.
Updates the Segment History by adding the split times of the most recent
attempt up to the provided current split index to the Segment History.
Updates the Segment History by adding the split times of the most recent attempt up to the provided current split index to the Segment History .
pub fn update_segment_history(&mut self, current_split_index: usize) {
        let mut last_split_time = Time::zero();
        let segments = self.segments.iter_mut().take(current_split_index);
        let index = self
            .attempt_history
            .last()
            .expect("There is no attempt in the Attempt History.")
            .index();
        for segment in segments {
            let split_time = segment.split_time();
            let segment_time = Time::op(split_time, last_split_time, |a, b| a - b);
            segment.segment_history_mut().insert(index, segment_time);
            if let Some(time) = split_time.real_time {
                last_split_time.real_time = Some(time);
            }
            if let Some(time) = split_time.game_time {
                last_split_time.game_time = Some(time);
            }
        }
    }
pub fn update_segment_history ( & mut self , current_split_index : usize ) { let mut last_split_time = Time :: zero ( ) ; let segments = self . segments . iter_mut ( ) . take ( current_split_index ) ; let index = self . attempt_history . last ( ) . expect ( " " ) . index ( ) ; for segment in segments { let split_time = segment . split_time ( ) ; let segment_time = Time :: op ( split_time , last_split_time , | a , b | a - b ) ; segment . segment_history_mut ( ) . insert ( index , segment_time ) ; if let Some ( time ) = split_time . real_time { last_split_time . real_time = Some ( time ) ; } if let Some ( time ) = split_time . game_time { last_split_time . game_time = Some ( time ) ; } } }
Updates the Segment History by adding the split times of the most recent
attempt up to the provided current split index to the Segment History.
Updates the Segment History by adding the split times of the most recent attempt up to the provided current split index to the Segment History .
&mut self
current_split_index
usize
&mut self
current_split_index
usize
panics
This panics if there is no attempt in the Attempt History.
This panics if there is no attempt in the Attempt History .