@@ -634,12 +634,12 @@ where
634634 let summary = signed_tx. transaction ( ) . text_summary ( chain_config) ;
635635 let result_hex: HexEncoded < SignedTransaction > = signed_tx. into ( ) ;
636636
637- let qr_code_string = ( ! self . no_qr )
638- . then ( || {
639- let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
640- format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
641- } )
642- . unwrap_or_default ( ) ;
637+ let qr_code_string = if self . no_qr {
638+ String :: new ( )
639+ } else {
640+ let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
641+ format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
642+ } ;
643643
644644 format ! (
645645 "The transaction has been fully signed and is ready to be broadcast to network. \
@@ -651,12 +651,12 @@ where
651651 let result_hex: HexEncoded < PartiallySignedTransaction > =
652652 partially_signed_tx. into ( ) ;
653653
654- let qr_code_string = ( ! self . no_qr )
655- . then ( || {
656- let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
657- format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
658- } )
659- . unwrap_or_default ( ) ;
654+ let qr_code_string = if self . no_qr {
655+ String :: new ( )
656+ } else {
657+ let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
658+ format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
659+ } ;
660660
661661 let prev_sigs = result
662662 . previous_signatures
@@ -692,12 +692,12 @@ where
692692 let result =
693693 wallet. sign_challenge_hex ( selected_account, challenge, address) . await ?;
694694
695- let qr_code_string = ( ! self . no_qr )
696- . then ( || {
697- let qr_code = qrcode_or_error_string ( & result ) ;
698- format ! ( " \n \n The following qr code also contains the signature for easy transport: \n {qr_code}" )
699- } )
700- . unwrap_or_default ( ) ;
695+ let qr_code_string = if self . no_qr {
696+ String :: new ( )
697+ } else {
698+ let qr_code = qrcode_or_error_string ( & result ) ;
699+ format ! ( " \n \n The following qr code also contains the signature for easy transport: \n {qr_code}" )
700+ } ;
701701
702702 Ok ( ConsoleCommand :: Print ( format ! (
703703 "The generated hex encoded signature is\n \n {result}{qr_code_string}" ,
@@ -711,12 +711,12 @@ where
711711 let ( wallet, selected_account) = wallet_and_selected_acc ( & mut self . wallet ) . await ?;
712712 let result = wallet. sign_challenge ( selected_account, challenge, address) . await ?;
713713
714- let qr_code_string = ( ! self . no_qr )
715- . then ( || {
716- let qr_code = qrcode_or_error_string ( & result ) ;
717- format ! ( " \n \n The following qr code also contains the signature for easy transport: \n {qr_code}" )
718- } )
719- . unwrap_or_default ( ) ;
714+ let qr_code_string = if self . no_qr {
715+ String :: new ( )
716+ } else {
717+ let qr_code = qrcode_or_error_string ( & result ) ;
718+ format ! ( " \n \n The following qr code also contains the signature for easy transport: \n {qr_code}" )
719+ } ;
720720
721721 Ok ( ConsoleCommand :: Print ( format ! (
722722 "The generated hex encoded signature is\n \n {result}{qr_code_string}" ,
@@ -1461,12 +1461,12 @@ where
14611461
14621462 let summary = tx. tx ( ) . text_summary ( chain_config) ;
14631463
1464- let qr_code_string = ( ! self . no_qr )
1465- . then ( || {
1466- let qr_code = qrcode_or_error_string ( & hex ) ;
1467- format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
1468- } )
1469- . unwrap_or_default ( ) ;
1464+ let qr_code_string = if self . no_qr {
1465+ String :: new ( )
1466+ } else {
1467+ let qr_code = qrcode_or_error_string ( & hex ) ;
1468+ format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
1469+ } ;
14701470
14711471 let mut output_str = format ! (
14721472 "Send transaction created. \
@@ -1761,12 +1761,12 @@ where
17611761 )
17621762 . await ?;
17631763
1764- let qr_code_string = ( ! self . no_qr )
1765- . then ( || {
1766- let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
1767- format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
1768- } )
1769- . unwrap_or_default ( ) ;
1764+ let qr_code_string = if self . no_qr {
1765+ String :: new ( )
1766+ } else {
1767+ let qr_code = qrcode_or_error_string ( & result_hex . to_string ( ) ) ;
1768+ format ! ( " \n \n Or scan the Qr code with it: \n \n {qr_code}" )
1769+ } ;
17701770
17711771 let output_str = format ! (
17721772 "Decommission transaction created. \
0 commit comments