Make the config.keygen optional in the configuration file

This commit is contained in:
Heiko Schaefer 2021-08-13 21:28:10 +02:00
parent 83d9a703db
commit 5237c1af85
2 changed files with 6 additions and 2 deletions

View file

@ -26,7 +26,7 @@ pub struct Card {
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
pub struct Config { pub struct Config {
pub keygen: Vec<String>, pub keygen: Option<Vec<String>>,
} }
/// An "opened" card, via one particular backend, with test-metadata /// An "opened" card, via one particular backend, with test-metadata

View file

@ -40,7 +40,11 @@ fn main() -> Result<()> {
let algos = { let algos = {
let config = card.get_config(); let config = card.get_config();
config.keygen.clone() if let Some(keygen) = &config.keygen {
keygen.clone()
} else {
vec![]
}
}; };
for algo in algos { for algo in algos {