pub fn replace_run(&mut self, mut run: Run, update_splits: bool) -> Result<Run, Run> {
        if run.is_empty() {
            return Err(run);
        }

        self.reset(update_splits);
        if !run.comparisons().any(|c| c == self.current_comparison) {
            self.current_comparison = personal_best::NAME.to_string();
        }

        run.fix_splits();
        run.regenerate_comparisons();

        Ok(mem::replace(&mut self.run, run))
    }
/// Replaces the Run object used by the Timer with the Run object provided.
/// If the Run provided contains no segments, it can't be used for timing
/// and is returned as the `Err` case of the `Result`. Otherwise the Run
/// that was in use by the Timer is being returned. Before the Run is
/// returned, the current attempt is reset and the splits are being updated
/// depending on the `update_splits` parameter.
Replaces the Run object used by the Timer with the Run object provided.
If the Run provided contains no segments, it can't be used for timing
and is returned as the `Err` case of the `Result`. Otherwise the Run
that was in use by the Timer is being returned. Before the Run is
returned, the current attempt is reset and the splits are being updated
depending on the `update_splits` parameter.
Replaces the Run object used by the Timer with the Run object provided . If the Run provided contains no segments it can ' t be used for timing and is returned as the ` Err ` case of the ` Result ` . Otherwise the Run that was in use by the Timer is being returned . Before the Run is returned the current attempt is reset and the splits are being updated depending on the ` update_splits ` parameter .
pub fn replace_run(&mut self, mut run: Run, update_splits: bool) -> Result<Run, Run> {
        if run.is_empty() {
            return Err(run);
        }
        self.reset(update_splits);
        if !run.comparisons().any(|c| c == self.current_comparison) {
            self.current_comparison = personal_best::NAME.to_string();
        }
        run.fix_splits();
        run.regenerate_comparisons();
        Ok(mem::replace(&mut self.run, run))
    }
pub fn replace_run ( & mut self , mut run : Run , update_splits : bool ) -> Result < Run , Run > { if run . is_empty ( ) { return Err ( run ) ; } self . reset ( update_splits ) ; if ! run . comparisons ( ) . any ( | c | c == self . current_comparison ) { self . current_comparison = personal_best :: NAME . to_string ( ) ; } run . fix_splits ( ) ; run . regenerate_comparisons ( ) ; Ok ( mem :: replace ( & mut self . run , run ) ) }
Replaces the Run object used by the Timer with the Run object provided.
Replaces the Run object used by the Timer with the Run object provided .
&mut self
run
Run
update_splits
bool
&mut self
run
Run
update_splits
bool