@@ -729,11 +729,11 @@ fn process_transfer(
729729 let proof_context_auditor_ciphertext_lo = proof_context
730730 . ciphertext_lo
731731 . try_extract_ciphertext ( 2 )
732- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
732+ . map_err ( TokenError :: from ) ?;
733733 let proof_context_auditor_ciphertext_hi = proof_context
734734 . ciphertext_hi
735735 . try_extract_ciphertext ( 2 )
736- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
736+ . map_err ( TokenError :: from ) ?;
737737
738738 check_auditor_ciphertext (
739739 transfer_amount_auditor_ciphertext_lo,
@@ -852,11 +852,11 @@ fn process_source_for_transfer(
852852 let source_transfer_amount_lo = proof_context
853853 . ciphertext_lo
854854 . try_extract_ciphertext ( 0 )
855- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
855+ . map_err ( TokenError :: from ) ?;
856856 let source_transfer_amount_hi = proof_context
857857 . ciphertext_hi
858858 . try_extract_ciphertext ( 0 )
859- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
859+ . map_err ( TokenError :: from ) ?;
860860
861861 let new_source_available_balance = ciphertext_arithmetic:: subtract_with_lo_hi (
862862 & confidential_transfer_account. available_balance ,
@@ -914,11 +914,11 @@ fn process_destination_for_transfer(
914914 let destination_ciphertext_lo = proof_context
915915 . ciphertext_lo
916916 . try_extract_ciphertext ( 1 )
917- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
917+ . map_err ( TokenError :: from ) ?;
918918 let destination_ciphertext_hi = proof_context
919919 . ciphertext_hi
920920 . try_extract_ciphertext ( 1 )
921- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
921+ . map_err ( TokenError :: from ) ?;
922922
923923 destination_confidential_transfer_account. pending_balance_lo = ciphertext_arithmetic:: add (
924924 & destination_confidential_transfer_account. pending_balance_lo ,
@@ -990,11 +990,11 @@ fn process_source_for_transfer_with_fee(
990990 let source_transfer_amount_lo = proof_context
991991 . ciphertext_lo
992992 . try_extract_ciphertext ( 0 )
993- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
993+ . map_err ( TokenError :: from ) ?;
994994 let source_transfer_amount_hi = proof_context
995995 . ciphertext_hi
996996 . try_extract_ciphertext ( 0 )
997- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
997+ . map_err ( TokenError :: from ) ?;
998998
999999 let new_source_available_balance = ciphertext_arithmetic:: subtract_with_lo_hi (
10001000 & confidential_transfer_account. available_balance ,
@@ -1053,11 +1053,11 @@ fn process_destination_for_transfer_with_fee(
10531053 let destination_transfer_amount_lo = proof_context
10541054 . ciphertext_lo
10551055 . try_extract_ciphertext ( 1 )
1056- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1056+ . map_err ( TokenError :: from ) ?;
10571057 let destination_transfer_amount_hi = proof_context
10581058 . ciphertext_hi
10591059 . try_extract_ciphertext ( 1 )
1060- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1060+ . map_err ( TokenError :: from ) ?;
10611061
10621062 destination_confidential_transfer_account. pending_balance_lo = ciphertext_arithmetic:: add (
10631063 & destination_confidential_transfer_account. pending_balance_lo ,
@@ -1080,11 +1080,11 @@ fn process_destination_for_transfer_with_fee(
10801080 let destination_fee_lo = proof_context
10811081 . fee_ciphertext_lo
10821082 . try_extract_ciphertext ( 0 )
1083- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1083+ . map_err ( TokenError :: from ) ?;
10841084 let destination_fee_hi = proof_context
10851085 . fee_ciphertext_hi
10861086 . try_extract_ciphertext ( 0 )
1087- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1087+ . map_err ( TokenError :: from ) ?;
10881088
10891089 // Subtract the fee amount from the destination pending balance
10901090 destination_confidential_transfer_account. pending_balance_lo =
@@ -1105,11 +1105,11 @@ fn process_destination_for_transfer_with_fee(
11051105 let withdraw_withheld_authority_fee_lo = proof_context
11061106 . fee_ciphertext_lo
11071107 . try_extract_ciphertext ( 1 )
1108- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1108+ . map_err ( TokenError :: from ) ?;
11091109 let withdraw_withheld_authority_fee_hi = proof_context
11101110 . fee_ciphertext_hi
11111111 . try_extract_ciphertext ( 1 )
1112- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1112+ . map_err ( TokenError :: from ) ?;
11131113
11141114 let destination_confidential_transfer_fee_amount =
11151115 destination_token_account. get_extension_mut :: < ConfidentialTransferFeeAmount > ( ) ?;
0 commit comments