Skip to content

Commit

Permalink
fix: assign the values of the clap boolean arguments to the configura…
Browse files Browse the repository at this point in the history
…tion only when they are true.
  • Loading branch information
dlachaume committed Oct 22, 2024
1 parent ef8c283 commit 878c74a
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions mithril-aggregator/src/commands/serve_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,30 @@ impl Source for ServeCommand {
),
);
}
result.insert(
"disable_digests_cache".to_string(),
Value::new(
Some(&namespace),
ValueKind::from(self.disable_digests_cache),
),
);
result.insert(
"reset_digests_cache".to_string(),
Value::new(Some(&namespace), ValueKind::from(self.reset_digests_cache)),
);
result.insert(
"allow_unparsable_block".to_string(),
Value::new(
Some(&namespace),
ValueKind::from(self.allow_unparsable_block),
),
);
result.insert(
"enable_metrics_server".to_string(),
Value::new(
Some(&namespace),
ValueKind::from(self.enable_metrics_server),
),
);
if self.disable_digests_cache {
result.insert(
"disable_digests_cache".to_string(),
Value::new(Some(&namespace), ValueKind::from(true)),
);
};
if self.reset_digests_cache {
result.insert(
"reset_digests_cache".to_string(),
Value::new(Some(&namespace), ValueKind::from(true)),
);
}
if self.allow_unparsable_block {
result.insert(
"allow_unparsable_block".to_string(),
Value::new(Some(&namespace), ValueKind::from(true)),
);
};
if self.enable_metrics_server {
result.insert(
"enable_metrics_server".to_string(),
Value::new(Some(&namespace), ValueKind::from(true)),
);
};
if let Some(metrics_server_ip) = self.metrics_server_ip.clone() {
result.insert(
"metrics_server_ip".to_string(),
Expand Down

0 comments on commit 878c74a

Please sign in to comment.