diff options
author | Hristo Venev <hristo@venev.name> | 2020-02-04 22:58:37 +0100 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2020-02-04 22:58:37 +0100 |
commit | 80589fb9c08e3c15b31db51c7a40767ff6fbf33d (patch) | |
tree | e75fc9e28a706e89c92fa04af8cbf51b8a574454 /src/config.rs | |
parent | e6c406879696a53d40f175d11d14a55d9480a57e (diff) |
Move source names inside the source sections.
This means that the order of the sources is preserved.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index 7b3aa4b..bbe6366 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,6 +10,7 @@ use std::path::PathBuf; #[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] #[serde(deny_unknown_fields)] pub struct Source { + pub name: String, pub url: String, pub psk: Option<Secret>, pub ipv4: Ipv4Set, @@ -81,7 +82,7 @@ pub struct Config { pub runtime_directory: Option<PathBuf>, pub global: GlobalConfig, pub updater: UpdaterConfig, - pub sources: HashMap<String, Source>, + pub sources: Vec<Source>, } #[derive(serde_derive::Serialize, serde_derive::Deserialize)] @@ -101,7 +102,7 @@ struct ConfigRepr { refresh_sec: u32, #[serde(default, rename = "source")] - sources: HashMap<String, Source>, + sources: Vec<Source>, } impl From<Config> for ConfigRepr { |