From 0e3bad139105de75d09e327531e798d4a53eab89 Mon Sep 17 00:00:00 2001 From: Steve Nease Date: Sun, 11 Sep 2022 17:11:05 -0500 Subject: [PATCH] ran cargo fmt --- src/benchmark/executor.rs | 4 +++- src/options.rs | 5 +++-- tests/integration_tests.rs | 16 ++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/benchmark/executor.rs b/src/benchmark/executor.rs index 64d621d..7d16870 100644 --- a/src/benchmark/executor.rs +++ b/src/benchmark/executor.rs @@ -1,7 +1,9 @@ use std::process::{ExitStatus, Stdio}; use crate::command::Command; -use crate::options::{CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell}; +use crate::options::{ + CmdFailureAction, CommandInputPolicy, CommandOutputPolicy, Options, OutputStyleOption, Shell, +}; use crate::output::progress_bar::get_progress_bar; use crate::timer::{execute_and_measure, TimerResult}; use crate::util::randomized_environment_offset; diff --git a/src/options.rs b/src/options.rs index 32a9636..d1706c5 100644 --- a/src/options.rs +++ b/src/options.rs @@ -231,7 +231,6 @@ pub struct Options { /// Where input to the benchmarked command comes from pub command_input_policy: CommandInputPolicy, - } impl Default for Options { @@ -392,7 +391,9 @@ impl Options { options.command_input_policy = if let Some(path_str) = matches.value_of("stdin-data") { let path = PathBuf::from(path_str); if !path.exists() { - return Err(OptionsError::StdinDataFileDoesNotExist(path_str.to_string())) + return Err(OptionsError::StdinDataFileDoesNotExist( + path_str.to_string(), + )); } CommandInputPolicy::File(path) } else { diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 073740c..810bdf0 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -216,7 +216,7 @@ fn runs_commands_using_user_defined_shell() { } #[test] -fn can_pass_file_data_to_command_via_stdin(){ +fn can_pass_file_data_to_command_via_stdin() { hyperfine() .arg("--runs=1") .arg("--stdin-data=example_stdin_data") @@ -224,13 +224,13 @@ fn can_pass_file_data_to_command_via_stdin(){ .arg("cat") .assert() .success() - .stdout( - predicate::str::contains("This data is passed to the command via stdin") - ); + .stdout(predicate::str::contains( + "This data is passed to the command via stdin", + )); } #[test] -fn fails_if_invalid_stdin_data_file_provided(){ +fn fails_if_invalid_stdin_data_file_provided() { hyperfine() .arg("--runs=1") .arg("--stdin-data=example_stdin_data_invalid") @@ -238,9 +238,9 @@ fn fails_if_invalid_stdin_data_file_provided(){ .arg("cat") .assert() .failure() - .stderr( - predicate::str::contains("File containing stdin data 'example_stdin_data_invalid' does not exist") - ); + .stderr(predicate::str::contains( + "File containing stdin data 'example_stdin_data_invalid' does not exist", + )); } #[test]