aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/config.rs b/src/config.rs
index 9972830..98a795f 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -39,16 +39,19 @@ impl Default for PeerConfig {
#[serde(deny_unknown_fields)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)]
-pub struct UpdateConfig {
+pub struct UpdaterConfig {
+ pub cache_directory: Option<PathBuf>,
+
// Number of seconds between regular updates.
#[serde(default = "default_refresh_sec")]
pub refresh_sec: u32,
}
-impl Default for UpdateConfig {
+impl Default for UpdaterConfig {
#[inline]
fn default() -> Self {
Self {
+ cache_directory: None,
refresh_sec: default_refresh_sec(),
}
}
@@ -57,14 +60,13 @@ impl Default for UpdateConfig {
#[serde(deny_unknown_fields)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Default, Clone, Debug)]
pub struct Config {
- pub cache_directory: Option<PathBuf>,
pub runtime_directory: Option<PathBuf>,
#[serde(flatten)]
pub peer_config: PeerConfig,
#[serde(flatten)]
- pub update_config: UpdateConfig,
+ pub updater: UpdaterConfig,
#[serde(rename = "source")]
pub sources: HashMap<String, Source>,