Skip to content

Commit

Permalink
Added default deserialization for missing fields in setting configura…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
danielsanchezq committed Jul 3, 2020
1 parent 199b8ef commit 0b127b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vit-servicing-station-lib/src/server/settings/config.rs
Expand Up @@ -29,9 +29,11 @@ pub struct ServiceSettings {
#[structopt(long, default_value = "0.0.0.0:3030")]
pub address: SocketAddr,

#[serde(default)]
#[structopt(flatten)]
pub tls: Tls,

#[serde(default)]
#[structopt(flatten)]
pub cors: Cors,

Expand All @@ -44,7 +46,7 @@ pub struct ServiceSettings {
pub block0_path: String,
}

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, StructOpt)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, StructOpt, Default)]
#[serde(deny_unknown_fields)]
#[structopt(rename_all = "kebab-case")]
pub struct Tls {
Expand Down

0 comments on commit 0b127b4

Please sign in to comment.