Fix some clippy warning
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Rémi Lauzier · committed by David Peter · parent edc1b4d · Browse files · 5 files·+10 added−12 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+10 added−12 removed
- other:+10 added−12 removed
Provenance
- Commit
aa162cd- Tree
8e06888- Author
Rémi Lauzier <remilauzier@protonmail.com>- Committer
David Peter <sharkdp@users.noreply.github.com>- Parent
edc1b4d
5 files changed+10 added−12 removed
modified:src/hyperfine/timer/unix_timer.rs+4 added-4 removed
49 unmodified lines50 51 const MICROSEC_PER_SEC: i64 = 1000 * 1000;52 53 CPUTimes {54- user_usec: i64::from(result.ru_utime.tv_sec) * MICROSEC_PER_SEC55- + i64::from(result.ru_utime.tv_usec),56- system_usec: i64::from(result.ru_stime.tv_sec) * MICROSEC_PER_SEC57- + i64::from(result.ru_stime.tv_usec),54+ user_usec: result.ru_utime.tv_sec * MICROSEC_PER_SEC55+ + result.ru_utime.tv_usec,56+ system_usec: result.ru_stime.tv_sec * MICROSEC_PER_SEC57+ + result.ru_stime.tv_usec,58 }59 }60 61 /// Compute the time intervals in between two `CPUTimes` snapshots34 unmodified linesmodified:src/hyperfine/app.rs-1 removed
1-use atty;1 use atty::Stream;2 use clap::{crate_version, App, AppSettings, Arg, ArgMatches};3 use std::ffi::OsString;4 238 unmodified linesmodified:src/hyperfine/internal.rs+5 added-5 removed
27 unmodified lines28 let progress_bar = match option {29 OutputStyleOption::Basic | OutputStyleOption::Color => ProgressBar::hidden(),30 _ => ProgressBar::new(length),31 };32- progress_bar.set_style(progressbar_style.clone());32+ progress_bar.set_style(progressbar_style);33 progress_bar.enable_steady_tick(TICK_SETTINGS.1);34 progress_bar.set_message(msg.to_owned());35 36 progress_bar26 unmodified lines63 fn compare_mean_time(l: &BenchmarkResult, r: &BenchmarkResult) -> Ordering {64 l.mean.partial_cmp(&r.mean).unwrap_or(Ordering::Equal)65 }66 67-pub fn compute_relative_speed<'a>(68- results: &'a [BenchmarkResult],69-) -> Option<Vec<BenchmarkResultWithRelativeSpeed<'a>>> {67+pub fn compute_relative_speed (68+ results: & [BenchmarkResult],69+) -> Option<Vec<BenchmarkResultWithRelativeSpeed>> {70 let fastest: &BenchmarkResult = results71 .iter()72 .min_by(|&l, &r| compare_mean_time(l, r))73 .expect("at least one benchmark result");113 unmodified lines187 188 assert!(annotated_results.is_none());189 }190 191-pub fn tokenize<'a>(values: &'a str) -> Vec<String> {191+pub fn tokenize(values: &str) -> Vec<String> {192 let mut tokens = vec![];193 let mut buf = String::new();194 195 let mut iter = values.chars();55 unmodified linesmodified:src/hyperfine/shell.rs-1 removed
1-use std;1 use std::io;2 use std::process::{Command, ExitStatus, Stdio};3 4 use crate::hyperfine::timer::get_cpu_timer;92 unmodified linesmodified:build.rs+1 added-1 removed
14 unmodified lines15 std::process::exit(1);16 }17 }18 19- let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));19+ let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or_else(|| std::env::var_os("OUT_DIR"));20 let outdir = match var {21 None => return,22 Some(outdir) => outdir,23 };8 unmodified lines