aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2019-09-28 16:12:03 +0000
committerHristo Venev <hristo@venev.name>2019-09-28 16:12:03 +0000
commit167a766f488091a9e6d833bb64e7e7cf8f90111f (patch)
tree568621ba7309be674821aae0684ca2378d063e0e /src/config.rs
parenta66bdaee155d9012b1fd75bf31332df638d49857 (diff)
Split updater into module.
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>,