pub fn update_state(&self, state: &mut key_value::State, timer: &Timer) {
        let resolved_comparison = comparison::resolve(&self.settings.comparison_override, timer);
        let comparison = comparison::or_current(resolved_comparison, timer);
        let key = self.text(resolved_comparison); // FIXME: Uncow

        let time = catch! {
            // FIXME: We shouldn't need to manually do this "bounds check".
            if timer.current_phase() == TimerPhase::Ended {
                return None;
            }

            comparison_single_segment_time(
                timer.run(),
                timer.current_split_index()?,
                comparison,
                timer.current_timing_method(),
            )?
        };

        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();

        state.key.clear();
        state.key.push_str(&key);

        state.value.clear();
        let _ = write!(
            state.value,
            "{}",
            SegmentTime::with_accuracy(self.settings.accuracy).format(time),
        );

        state.key_abbreviations.clear();
        match &*key {
            "Best Segment Time" => {
                state.key_abbreviations.push("Best Seg. Time".into());
                state.key_abbreviations.push("Best Segment".into());
            }
            "Worst Segment Time" => {
                state.key_abbreviations.push("Worst Seg. Time".into());
                state.key_abbreviations.push("Worst Segment".into());
            }
            "Average Segment Time" => {
                state.key_abbreviations.push("Average Seg. Time".into());
                state.key_abbreviations.push("Average Segment".into());
            }
            "Median Segment Time" => {
                state.key_abbreviations.push("Median Seg. Time".into());
                state.key_abbreviations.push("Median Segment".into());
            }
            "Latest Segment Time" => {
                state.key_abbreviations.push("Latest Seg. Time".into());
                state.key_abbreviations.push("Latest Segment".into());
            }
            "Segment Time" => state.key_abbreviations.push("Seg. Time".into()),
            _ => {
                state.key_abbreviations.push("Segment Time".into());
                state.key_abbreviations.push("Seg. Time".into());
            }
        };

        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = false;
    }
/// Updates the component's state based on the timer provided.
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
pub fn update_state(&self, state: &mut key_value::State, timer: &Timer) {
        let resolved_comparison = comparison::resolve(&self.settings.comparison_override, timer);
        let comparison = comparison::or_current(resolved_comparison, timer);
        let key = self.text(resolved_comparison); // FIXME: Uncow
        let time = catch! {
            // FIXME: We shouldn't need to manually do this "bounds check".
            if timer.current_phase() == TimerPhase::Ended {
                return None;
            }
            comparison_single_segment_time(
                timer.run(),
                timer.current_split_index()?,
                comparison,
                timer.current_timing_method(),
            )?
        };
        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();
        state.key.clear();
        state.key.push_str(&key);
        state.value.clear();
        let _ = write!(
            state.value,
            "{}",
            SegmentTime::with_accuracy(self.settings.accuracy).format(time),
        );
        state.key_abbreviations.clear();
        match &*key {
            "Best Segment Time" => {
                state.key_abbreviations.push("Best Seg. Time".into());
                state.key_abbreviations.push("Best Segment".into());
            }
            "Worst Segment Time" => {
                state.key_abbreviations.push("Worst Seg. Time".into());
                state.key_abbreviations.push("Worst Segment".into());
            }
            "Average Segment Time" => {
                state.key_abbreviations.push("Average Seg. Time".into());
                state.key_abbreviations.push("Average Segment".into());
            }
            "Median Segment Time" => {
                state.key_abbreviations.push("Median Seg. Time".into());
                state.key_abbreviations.push("Median Segment".into());
            }
            "Latest Segment Time" => {
                state.key_abbreviations.push("Latest Seg. Time".into());
                state.key_abbreviations.push("Latest Segment".into());
            }
            "Segment Time" => state.key_abbreviations.push("Seg. Time".into()),
            _ => {
                state.key_abbreviations.push("Segment Time".into());
                state.key_abbreviations.push("Seg. Time".into());
            }
        };
        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = false;
    }
pub fn update_state ( & self , state : & mut key_value :: State , timer : & Timer ) { let resolved_comparison = comparison :: resolve ( & self . settings . comparison_override , timer ) ; let comparison = comparison :: or_current ( resolved_comparison , timer ) ; let key = self . text ( resolved_comparison ) ; // FIXME: Uncow let time = catch ! { // FIXME: We shouldn't need to manually do this "bounds check". if timer current_phase ( ) TimerPhase Ended { return None } comparison_single_segment_time ( timer run ( ) timer current_split_index ( ) comparison timer current_timing_method ( ) ) } ; state . background = self . settings . background ; state . key_color = self . settings . label_color ; state . value_color = self . settings . value_color ; state . semantic_color = Default :: default ( ) ; state . key . clear ( ) ; state . key . push_str ( & key ) ; state . value . clear ( ) ; let _ = write ! ( state value " " SegmentTime with_accuracy ( self settings accuracy ) format ( time ) ) ; state . key_abbreviations . clear ( ) ; match & * key { " " => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } " " => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } " " => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } " " => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } " " => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } " " => state . key_abbreviations . push ( " " . into ( ) ) , _ => { state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; } } ; state . display_two_rows = self . settings . display_two_rows ; state . updates_frequently = false ; }
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
&self
state
&mut key_value::State
timer
&Timer
&self
state
&mut key_value::State
timer
&Timer