Skip to content

Commit

Permalink
cli: bench: place command dispatcher function closer to enum definition
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Nov 4, 2024
1 parent 0ae2821 commit 541376b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cli/src/commands/bench/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ pub enum BenchCommand {
Revset(BenchRevsetArgs),
}

pub(crate) fn cmd_bench(
ui: &mut Ui,
command: &CommandHelper,
subcommand: &BenchCommand,
) -> Result<(), CommandError> {
match subcommand {
BenchCommand::CommonAncestors(args) => cmd_bench_common_ancestors(ui, command, args),
BenchCommand::IsAncestor(args) => cmd_bench_is_ancestor(ui, command, args),
BenchCommand::ResolvePrefix(args) => cmd_bench_resolve_prefix(ui, command, args),
BenchCommand::Revset(args) => cmd_bench_revset(ui, command, args),
}
}

#[derive(clap::Args, Clone, Debug)]
struct CriterionArgs {
/// Name of baseline to save results
Expand Down Expand Up @@ -94,16 +107,3 @@ where
});
Ok(())
}

pub(crate) fn cmd_bench(
ui: &mut Ui,
command: &CommandHelper,
subcommand: &BenchCommand,
) -> Result<(), CommandError> {
match subcommand {
BenchCommand::CommonAncestors(args) => cmd_bench_common_ancestors(ui, command, args),
BenchCommand::IsAncestor(args) => cmd_bench_is_ancestor(ui, command, args),
BenchCommand::ResolvePrefix(args) => cmd_bench_resolve_prefix(ui, command, args),
BenchCommand::Revset(args) => cmd_bench_revset(ui, command, args),
}
}

0 comments on commit 541376b

Please sign in to comment.