mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 17:11:28 +00:00
Fix clippy warning
This commit is contained in:
1 parent
2d0cd4b53c
commit
250db61fa0
2 files changed
+4
-2
No files matched your search
+1
-1
@@ -209,7 +209,7 @@ impl<'a> Commands<'a> {
|
|||||||
self.0.iter()
|
self.0.iter()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn len(&self) -> usize {
|
pub fn num_commands(&self) -> usize {
|
||||||
self.0.len()
|
self.0.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -22,6 +22,7 @@ pub const DEFAULT_SHELL: &str = "cmd.exe";
|
|||||||
pub enum Shell {
|
pub enum Shell {
|
||||||
/// Default shell command
|
/// Default shell command
|
||||||
Default(&'static str),
|
Default(&'static str),
|
||||||
|
|
||||||
/// Custom shell command specified via --shell
|
/// Custom shell command specified via --shell
|
||||||
Custom(Vec<String>),
|
Custom(Vec<String>),
|
||||||
}
|
}
|
||||||
@@ -264,7 +265,8 @@ impl Options {
|
|||||||
pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> {
|
pub fn validate_against_command_list(&self, commands: &Commands) -> Result<()> {
|
||||||
if let Some(preparation_command) = &self.preparation_command {
|
if let Some(preparation_command) = &self.preparation_command {
|
||||||
ensure!(
|
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 \
|
"The '--prepare' option has to be provided just once or N times, where N is the \
|
||||||
number of benchmark commands."
|
number of benchmark commands."
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user