diff --git a/src/benchmark/executor.rs b/src/benchmark/executor.rs index 1682188..76b34c3 100644 --- a/src/benchmark/executor.rs +++ b/src/benchmark/executor.rs @@ -62,7 +62,7 @@ impl<'a> Executor for ShellExecutor<'a> { }; let wallclock_timer = WallClockTimer::start(); - let result = execute_and_time(stdout, stderr, &command.get_shell_command(), &self.shell)?; + let result = execute_and_time(stdout, stderr, &command.get_shell_command(), self.shell)?; let mut time_real = wallclock_timer.stop(); let mut time_user = result.user_time; diff --git a/src/benchmark/scheduler.rs b/src/benchmark/scheduler.rs index 9b259f8..89025eb 100644 --- a/src/benchmark/scheduler.rs +++ b/src/benchmark/scheduler.rs @@ -34,7 +34,7 @@ impl<'a> Scheduler<'a> { pub fn run_benchmarks(&mut self) -> Result<()> { let mut executor: Box = match self.options.executor_kind { ExecutorKind::Mock(ref shell) => Box::new(MockExecutor::new(shell.clone())), - ExecutorKind::Shell(ref shell) => Box::new(ShellExecutor::new(shell, &self.options)), + ExecutorKind::Shell(ref shell) => Box::new(ShellExecutor::new(shell, self.options)), }; executor.calibrate()?; diff --git a/src/options.rs b/src/options.rs index 08aa38e..5aa84ef 100644 --- a/src/options.rs +++ b/src/options.rs @@ -44,7 +44,7 @@ impl fmt::Display for Shell { impl Shell { /// Parse given string as shell command line - pub fn from_str<'a>(s: &str) -> Result> { + pub fn parse_from_str<'a>(s: &str) -> Result> { let v = shell_words::split(s).map_err(OptionsError::ShellParseError)?; if v.is_empty() || v[0].is_empty() { return Err(OptionsError::EmptyShell); @@ -274,7 +274,7 @@ impl Options { options.executor_kind = match (matches.is_present("debug-mode"), matches.value_of("shell")) { - (false, Some(shell)) => ExecutorKind::Shell(Shell::from_str(shell)?), + (false, Some(shell)) => ExecutorKind::Shell(Shell::parse_from_str(shell)?), (false, None) => ExecutorKind::Shell(Shell::default()), (true, Some(shell)) => ExecutorKind::Mock(Some(shell.into())), (true, None) => ExecutorKind::Mock(None), @@ -320,7 +320,7 @@ fn test_default_shell() { #[test] fn test_can_parse_shell_command_line_from_str() { - let shell = Shell::from_str("shell -x 'aaa bbb'").unwrap(); + let shell = Shell::parse_from_str("shell -x 'aaa bbb'").unwrap(); let s = format!("{}", shell); assert_eq!(&s, "shell -x 'aaa bbb'"); @@ -336,17 +336,17 @@ fn test_can_parse_shell_command_line_from_str() { // Error cases assert!(matches!( - Shell::from_str("shell 'foo").unwrap_err(), + Shell::parse_from_str("shell 'foo").unwrap_err(), OptionsError::ShellParseError(_) )); assert!(matches!( - Shell::from_str("").unwrap_err(), + Shell::parse_from_str("").unwrap_err(), OptionsError::EmptyShell )); assert!(matches!( - Shell::from_str("''").unwrap_err(), + Shell::parse_from_str("''").unwrap_err(), OptionsError::EmptyShell )); }