Fix clippy warning

This commit is contained in:
David Peter authored and David Peter committed 2022-02-22 09:07:40 +01:00
1 parent 2d0cd4b53c
commit 250db61fa0
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -209,7 +209,7 @@ impl<'a> Commands<'a> {
self.0.iter()
}
pub fn len(&self) -> usize {
pub fn num_commands(&self) -> usize {
self.0.len()
}
+3 -1
View File
@@ -22,6 +22,7 @@ pub const DEFAULT_SHELL: &str = "cmd.exe";
pub enum Shell {
/// Default shell command
Default(&'static str),
/// Custom shell command specified via --shell
Custom(Vec<String>),
}
@@ -264,7 +265,8 @@ impl Options {
pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> {
if let Some(preparation_command) = &self.preparation_command {
ensure!(
preparation_command.len() <= 1 || commands.len() == preparation_command.len(),
preparation_command.len() <= 1
|| commands.num_commands() == preparation_command.len(),
"The '--prepare' option has to be provided just once or N times, where N is the \
number of benchmark commands."
);