Merges new and validate methods of RangeStep into one method, renames error names according to code review.

This commit is contained in:
Steven Gu authored and David Peter committed 2021-07-27 22:34:38 +02:00
1 parent d4a0e9afb6
commit 28e8c315dc
3 files changed
+52 -53

No files matched your search

+4 -5
View File
@@ -255,13 +255,12 @@ fn build_commands<'a>(matches: &'a ArgMatches<'_>) -> Vec<Command<'a>> {
return Vec::new();
}
// `--command-name` should appear exactly once or same count with parameters.
// `--command-name` should appear exactly once or exactly B times,
// where B is the total number of benchmarks.
let command_name_count = command_names.len();
if command_name_count > 1 && command_name_count != param_space_size {
let err = OptionsError::DifferentCommandNameCountWithParameters(
command_name_count,
param_space_size,
);
let err =
OptionsError::UnexpectedCommandNameCount(command_name_count, param_space_size);
error(&err.to_string());
}