From 939ea56b2124f02a7ffa1f4afd8684ac090d5e67 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 27 Mar 2022 12:08:01 +0800 Subject: [PATCH] chore: format --- src/chall.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/chall.rs b/src/chall.rs index afe4684..e1db22b 100644 --- a/src/chall.rs +++ b/src/chall.rs @@ -22,9 +22,8 @@ impl Command for CommandImpl { fn run(&self, _arg_matches: &ArgMatches, sub_arg_matches: &ArgMatches) -> CommandError { let json_output = sub_arg_matches.is_present("json"); - if json_output { - rust_util::util_msg::set_logger_std_out(false); - } + if json_output { rust_util::util_msg::set_logger_std_out(false); } + let sha256_output = sub_arg_matches.is_present("sha256"); let sha384_output = sub_arg_matches.is_present("sha384"); let sha512_output = sub_arg_matches.is_present("sha512"); @@ -32,7 +31,7 @@ impl Command for CommandImpl { if let Some(challenge) = sub_arg_matches.value_of("challenge") { challenge_bytes = challenge.as_bytes().to_vec(); } else if let Some(challenge_hex) = sub_arg_matches.value_of("challenge-hex") { - challenge_bytes = hex::decode(challenge_hex)?; + challenge_bytes = opt_result!(hex::decode(challenge_hex), "Decode challenge hex: {}, failed: {}", challenge_hex); } else { return simple_error!("Challenge must assigned"); }