cleanup: remove WatchmanConfig Default impl
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run

This one was actually used, but only in a debug command.
This commit is contained in:
Ilya Grigoriev 2025-01-17 22:03:37 -08:00
parent 3404085ec4
commit 027589d199
2 changed files with 8 additions and 4 deletions

View file

@ -50,6 +50,10 @@ pub fn cmd_debug_watchman(
let mut workspace_command = command.workspace_helper(ui)?;
let repo = workspace_command.repo().clone();
let watchman_config = WatchmanConfig {
// The value is likely irrelevant here. TODO(ilyagr): confirm
register_trigger: false,
};
match subcommand {
DebugWatchmanCommand::Status => {
// TODO(ilyagr): It would be nice to add colors here
@ -76,7 +80,7 @@ pub fn cmd_debug_watchman(
ui.stdout(),
"Attempting to contact the `watchman` CLI regardless..."
)?;
WatchmanConfig::default()
watchman_config
}
other_fsmonitor => {
return Err(user_error(format!(
@ -102,12 +106,12 @@ pub fn cmd_debug_watchman(
}
DebugWatchmanCommand::QueryClock => {
let wc = check_local_disk_wc(workspace_command.working_copy().as_any())?;
let (clock, _changed_files) = wc.query_watchman(&WatchmanConfig::default())?;
let (clock, _changed_files) = wc.query_watchman(&watchman_config)?;
writeln!(ui.stdout(), "Clock: {clock:?}")?;
}
DebugWatchmanCommand::QueryChangedFiles => {
let wc = check_local_disk_wc(workspace_command.working_copy().as_any())?;
let (_clock, changed_files) = wc.query_watchman(&WatchmanConfig::default())?;
let (_clock, changed_files) = wc.query_watchman(&watchman_config)?;
writeln!(ui.stdout(), "Changed files: {changed_files:?}")?;
}
DebugWatchmanCommand::ResetClock => {

View file

@ -28,7 +28,7 @@ use crate::config::ConfigGetError;
use crate::settings::UserSettings;
/// Config for Watchman filesystem monitor (<https://facebook.github.io/watchman/>).
#[derive(Default, Eq, PartialEq, Clone, Debug)]
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct WatchmanConfig {
/// Whether to use triggers to monitor for changes in the background.
pub register_trigger: bool,