From c28c07c17d40f7c5f8a647ee40f3bf14e535a075 Mon Sep 17 00:00:00 2001 From: thojest Date: Sun, 3 Mar 2019 14:15:00 +0100 Subject: [PATCH] validator_client: added default_value for spec; used unreachable macro for custom spec (lighthouse-252) --- validator_client/src/main.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/validator_client/src/main.rs b/validator_client/src/main.rs index f81c3e40c..4344bc16e 100644 --- a/validator_client/src/main.rs +++ b/validator_client/src/main.rs @@ -50,7 +50,8 @@ fn main() { .short("s") .help("Configuration of Beacon Chain") .takes_value(true) - .possible_values(&["foundation", "few_validators"]), + .possible_values(&["foundation", "few_validators"]) + .default_value("foundation"), ) .get_matches(); @@ -77,11 +78,8 @@ fn main() { match spec_str { "foundation" => config.spec = ChainSpec::foundation(), "few_validators" => config.spec = ChainSpec::few_validators(), - // Should be impossible - _ => { - error!(log, "Invalid ChainSpec defined"; "spec" => spec_str); - return; - } + // Should be impossible due to clap's `possible_values(..)` function. + _ => unreachable!(), }; }