pub fn import_best_segment(&mut self, segment_index: usize) {
        let best_segment_time = self.segments[segment_index].best_segment_time();
        if best_segment_time.real_time.is_some() || best_segment_time.game_time.is_some() {
            // We can unwrap here because due to the fact that we can access the
            // best_segment_time of some segment, at least one exists.
            let index = self.min_segment_history_index().unwrap() - 1;
            self.segments[segment_index]
                .segment_history_mut()
                .insert(index, best_segment_time);
        }
    }
/// Fixes a segment's Segment History by adding its Best Segment Time to its
/// Segment History.
///
/// # Panics
///
/// This panics if the segment index provided is out of bounds.
Fixes a segment's Segment History by adding its Best Segment Time to its
Segment History.
Fixes a segment ' s Segment History by adding its Best Segment Time to its Segment History .
pub fn import_best_segment(&mut self, segment_index: usize) {
        let best_segment_time = self.segments[segment_index].best_segment_time();
        if best_segment_time.real_time.is_some() || best_segment_time.game_time.is_some() {
            // We can unwrap here because due to the fact that we can access the
            // best_segment_time of some segment, at least one exists.
            let index = self.min_segment_history_index().unwrap() - 1;
            self.segments[segment_index]
                .segment_history_mut()
                .insert(index, best_segment_time);
        }
    }
pub fn import_best_segment ( & mut self , segment_index : usize ) { let best_segment_time = self . segments [ segment_index ] . best_segment_time ( ) ; if best_segment_time . real_time . is_some ( ) || best_segment_time . game_time . is_some ( ) { // We can unwrap here because due to the fact that we can access the // best_segment_time of some segment, at least one exists. let index = self . min_segment_history_index ( ) . unwrap ( ) - 1 ; self . segments [ segment_index ] . segment_history_mut ( ) . insert ( index , best_segment_time ) ; } }
Fixes a segment's Segment History by adding its Best Segment Time to its
Segment History.
Fixes a segment ' s Segment History by adding its Best Segment Time to its Segment History .
&mut self
segment_index
usize
&mut self
segment_index
usize
panics
This panics if the segment index provided is out of bounds.
This panics if the segment index provided is out of bounds .