summaryrefslogtreecommitdiff
path: root/cli/tools/bench.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-06-15 13:09:37 -0400
committerGitHub <noreply@github.com>2023-06-15 13:09:37 -0400
commitfa63fd4610fbe4a1d95c4da776e4a1cfa8f8e0b9 (patch)
treec23b95ed50ed20351b543c900cc970cd9e382ac1 /cli/tools/bench.rs
parentb2e546e530374ca9456aa3f6ff195c3384b32f24 (diff)
refactor(flags): move watch flags into subcommand structs (#19516)
Moves the watch setting out of the `Flags` struct and into the individual subcommands
Diffstat (limited to 'cli/tools/bench.rs')
-rw-r--r--cli/tools/bench.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs
index 318ac4f36..f926cec5a 100644
--- a/cli/tools/bench.rs
+++ b/cli/tools/bench.rs
@@ -684,12 +684,15 @@ pub async fn run_benchmarks_with_watch(
flags: Flags,
bench_flags: BenchFlags,
) -> Result<(), AnyError> {
- let clear_screen = !flags.no_clear_screen;
file_watcher::watch_func(
flags,
file_watcher::PrintConfig {
job_name: "Bench".to_string(),
- clear_screen,
+ clear_screen: bench_flags
+ .watch
+ .as_ref()
+ .map(|w| !w.no_clear_screen)
+ .unwrap_or(true),
},
move |flags, sender, changed_paths| {
let bench_flags = bench_flags.clone();
@@ -701,9 +704,7 @@ pub async fn run_benchmarks_with_watch(
let cli_options = factory.cli_options();
let bench_options = cli_options.resolve_bench_options(bench_flags)?;
- if let Some(watch_paths) = cli_options.watch_paths() {
- let _ = sender.send(watch_paths);
- }
+ let _ = sender.send(cli_options.watch_paths());
let _ = sender.send(bench_options.files.include.clone());
let graph_kind = cli_options.type_check_mode().as_graph_kind();