ApplicationConfig: abolish accessor

This commit is contained in:
Ian Jackson 2022-03-21 12:39:17 +00:00
parent 85cf744e9e
commit 94f4728a1c
3 changed files with 3 additions and 10 deletions

View File

@ -28,14 +28,7 @@ pub struct ApplicationConfig {
/// recreated, or for some other reason).
#[serde(default)]
#[builder(default)]
watch_configuration: bool,
}
impl ApplicationConfig {
/// Return true if we're configured to watch for configuration changes.
pub fn watch_configuration(&self) -> bool {
self.watch_configuration
}
pub(crate) watch_configuration: bool,
}
/// Configuration for one or more proxy listeners.

View File

@ -159,7 +159,7 @@ pub async fn run<R: Runtime>(
.config(client_config)
.bootstrap_behavior(OnDemand)
.create_unbootstrapped()?;
if arti_config.application().watch_configuration() {
if arti_config.application().watch_configuration {
watch_cfg::watch_for_config_changes(config_sources, arti_config, client.clone())?;
}

View File

@ -95,7 +95,7 @@ fn reconfigure<R: Runtime>(
let client_config = config.tor_client_config()?;
client.reconfigure(&client_config, Reconfigure::WarnOnFailures)?;
if !config.application().watch_configuration() {
if !config.application().watch_configuration {
// Stop watching for configuration changes.
return Ok(true);
}