Repository: sharkdp/hyperfine
File: src/benchmark.rs (Rust)

Code before:
            options.failure_action,
            Some(shell_spawning_time),
        )?;
        let success = status.success();

        times_real.push(res.time_real);
        times_user.push(res.time_user);
        times_system.push(res.time_system);
        exit_codes.push(extract_exit_code(status));

        all_succeeded = all_succeeded && success;

        if let Some(bar) = progress_bar.as_ref() {
            bar.inc(1)
        }
    }

    if let Some(bar) = progress_bar.as_ref() {
        bar.finish_and_clear()
    }

    // Compute statistical quantities
    let t_num = times_real.len();
    let t_mean = mean(&times_real);
    let mut t_stddev = 0.0;
    if *&times_real.len() != 1 {
        t_stddev = standard_deviation(&times_real, Some(t_mean));
    }
    let t_median = median(&times_real);
    let t_min = min(&times_real);
    let t_max = max(&times_real);

    let user_mean = mean(&times_user);
    let system_mean = mean(&times_system);

    // Formatting and console output
    let (mean_str, time_unit) = format_duration_unit(t_mean, options.time_unit);
    let stddev_str = format_duration(t_stddev, Some(time_unit));
    let min_str = format_duration(t_min, Some(time_unit));
    let max_str = format_duration(t_max, Some(time_unit));
    let num_str = format!("{} runs", t_num);

    let user_str = format_duration(user_mean, Some(time_unit));
    let system_str = format_duration(system_mean, Some(time_unit));

    if options.output_style != OutputStyleOption::Disabled && *&times_real.len() == 1 {
        println!(
            "  Time ({} ≡):        {:>8}  {:>8}     [User: {}, System: {}]",
            "abs".green().bold(),
            mean_str.green().bold(),
            "        ".to_string(), // alignment

Review comment (suggestion):
It would be great if you could fix the clippy warning (see below). There is a similar warning below.

Code after:
            options.failure_action,
            Some(shell_spawning_time),
        )?;
        let success = status.success();

        times_real.push(res.time_real);
        times_user.push(res.time_user);
        times_system.push(res.time_system);
        exit_codes.push(extract_exit_code(status));

        all_succeeded = all_succeeded && success;

        if let Some(bar) = progress_bar.as_ref() {
            bar.inc(1)
        }
    }

    if let Some(bar) = progress_bar.as_ref() {
        bar.finish_and_clear()
    }

    // Compute statistical quantities
    let t_num = times_real.len();
    let t_mean = mean(&times_real);
    let t_stddev = if times_real.len() > 1 {
        Some(standard_deviation(&times_real, Some(t_mean)))
    } else {
        None
    };
    let t_median = median(&times_real);
    let t_min = min(&times_real);
    let t_max = max(&times_real);

    let user_mean = mean(&times_user);
    let system_mean = mean(&times_system);

    // Formatting and console output
    let (mean_str, time_unit) = format_duration_unit(t_mean, options.time_unit);
    let min_str = format_duration(t_min, Some(time_unit));
    let max_str = format_duration(t_max, Some(time_unit));
    let num_str = format!("{} runs", t_num);

    let user_str = format_duration(user_mean, Some(time_unit));
    let system_str = format_duration(system_mean, Some(time_unit));

    if options.output_style != OutputStyleOption::Disabled {
        if times_real.len() == 1 {
            println!(
                "  Time ({} ≡):        {:>8}  {:>8}     [User: {}, System: {}]",
                "abs".green().bold(),
                mean_str.green().bold(),