Skip to content
Myr

Fix clippy suggestions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent f443195 · Browse files · 7 files+23 added−31 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

7 files+23 added−31 removed

  • other:+23 added−31 removed

7 files+23 added−31 removed

modified:.github/workflows/CICD.yml+1 added-1 removed
1name: CICD23env:4 MIN_SUPPORTED_RUST_VERSION: "1.54.0"4 MIN_SUPPORTED_RUST_VERSION: "1.57.0"5 CICD_INTERMEDIATES_DIR: "_cicd-intermediates"67on:8 workflow_dispatch:
330 unmodified lines
modified:src/export/asciidoc.rs+3 added-5 removed
72 unmodified lines
73 let max_str = format_duration_value(result.max, Some(unit)).0;74 let rel_str = format!("{:.2}", entry.relative_speed);75 let rel_stddev_str = if entry.is_fastest {76 "".into()77 } else if let Some(stddev) = entry.relative_speed_stddev {78 format!(" ± {:.2}", stddev)79 } else {78 if let Some(stddev) = entry.relative_speed_stddev {79 format!(" ± {:.2}", stddev)80 } else {81 "".into()80 "".into()82 }81 };8283 format!(84 "| `{command}` \n\
200 unmodified lines
modified:src/export/markdown.rs+3 added-5 removed
61 unmodified lines
62 let max_str = format_duration_value(result.max, Some(unit)).0;63 let rel_str = format!("{:.2}", entry.relative_speed);64 let rel_stddev_str = if entry.is_fastest {65 "".into()66 } else if let Some(stddev) = entry.relative_speed_stddev {67 format!(" ± {:.2}", stddev)68 } else {67 if let Some(stddev) = entry.relative_speed_stddev {68 format!(" ± {:.2}", stddev)69 } else {70 "".into()69 "".into()71 }70 };7172 dest.extend(73 format!(
221 unmodified lines
modified:src/error.rs+1 added-1 removed
53 unmodified lines
54}5556impl Error for ParameterScanError {}5758#[derive(Debug)]58#[derive(Debug, PartialEq)]59pub enum OptionsError<'a> {60 EmptyRunsRange,61 TooManyCommandNames(usize),62 UnexpectedCommandNameCount(usize, usize),
34 unmodified lines
modified:src/main.rs+1 added-1 removed
259 unmodified lines
260 Ok(export_manager)261}262263/// Build the commands to benchmark264fn build_commands<'a>(matches: &'a ArgMatches) -> Vec<Command<'a>> {264fn build_commands(matches: &ArgMatches) -> Vec<Command> {265 let command_names = matches.values_of("command-name");266 let command_strings = matches.values_of("command").unwrap();267268 if let Some(args) = matches.values_of("parameter-scan") {
186 unmodified lines
modified:src/options.rs+13 added-17 removed
180 unmodified lines
181 let s = format!("{}", shell);182 assert_eq!(&s, "shell -x 'aaa bbb'");183184 let cmd = shell.command();185 // Command::get_program and Command::args are not yet available in stable channel.186 // https://doc.rust-lang.org/std/process/struct.Command.html#method.get_program187 let s = format!("{:?}", cmd);188 assert_eq!(&s, r#""shell" "-x" "aaa bbb""#);185 assert_eq!(cmd.get_program().to_string_lossy(), "shell");186 assert_eq!(187 cmd.get_args()188 .map(|a| a.to_string_lossy())189 .collect::<Vec<_>>(),190 vec!["-x", "aaa bbb"]191 );192193 // Error cases194 assert!(matches!(195 Shell::parse("shell 'foo").unwrap_err(),196 OptionsError::ShellParseError(_)197 ));198192 match Shell::parse("shell 'foo").unwrap_err() {193 OptionsError::ShellParseError(_) => { /* ok */ }194 e => assert!(false, "Unexpected error: {}", e),195 }199 assert_eq!(Shell::parse("").unwrap_err(), OptionsError::EmptyShell);200197 match Shell::parse("").unwrap_err() {198 OptionsError::EmptyShell => { /* ok */ }199 e => assert!(false, "Unexpected error: {}", e),200 }201202 match Shell::parse("''").unwrap_err() {203 OptionsError::EmptyShell => { /* ok */ }204 e => assert!(false, "Unexpected error: {}", e),205 }201 assert_eq!(Shell::parse("''").unwrap_err(), OptionsError::EmptyShell);202}
modified:README.md+1 added-1 removed
206 unmodified lines
207```208cargo install hyperfine209```210211Make sure that you use Rust 1.54 or higher.211Make sure that you use Rust 1.57 or higher.212213### From binaries (Linux, macOS, Windows)214215Download the corresponding archive from the [Release page](https://github.com/sharkdp/hyperfine/releases).
24 unmodified lines