@@ -729,11 +729,11 @@ fn process_transfer(
729
729
let proof_context_auditor_ciphertext_lo = proof_context
730
730
. ciphertext_lo
731
731
. try_extract_ciphertext ( 2 )
732
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
732
+ . map_err ( TokenError :: from ) ?;
733
733
let proof_context_auditor_ciphertext_hi = proof_context
734
734
. ciphertext_hi
735
735
. try_extract_ciphertext ( 2 )
736
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
736
+ . map_err ( TokenError :: from ) ?;
737
737
738
738
check_auditor_ciphertext (
739
739
transfer_amount_auditor_ciphertext_lo,
@@ -852,11 +852,11 @@ fn process_source_for_transfer(
852
852
let source_transfer_amount_lo = proof_context
853
853
. ciphertext_lo
854
854
. try_extract_ciphertext ( 0 )
855
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
855
+ . map_err ( TokenError :: from ) ?;
856
856
let source_transfer_amount_hi = proof_context
857
857
. ciphertext_hi
858
858
. try_extract_ciphertext ( 0 )
859
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
859
+ . map_err ( TokenError :: from ) ?;
860
860
861
861
let new_source_available_balance = ciphertext_arithmetic:: subtract_with_lo_hi (
862
862
& confidential_transfer_account. available_balance ,
@@ -914,11 +914,11 @@ fn process_destination_for_transfer(
914
914
let destination_ciphertext_lo = proof_context
915
915
. ciphertext_lo
916
916
. try_extract_ciphertext ( 1 )
917
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
917
+ . map_err ( TokenError :: from ) ?;
918
918
let destination_ciphertext_hi = proof_context
919
919
. ciphertext_hi
920
920
. try_extract_ciphertext ( 1 )
921
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
921
+ . map_err ( TokenError :: from ) ?;
922
922
923
923
destination_confidential_transfer_account. pending_balance_lo = ciphertext_arithmetic:: add (
924
924
& destination_confidential_transfer_account. pending_balance_lo ,
@@ -990,11 +990,11 @@ fn process_source_for_transfer_with_fee(
990
990
let source_transfer_amount_lo = proof_context
991
991
. ciphertext_lo
992
992
. try_extract_ciphertext ( 0 )
993
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
993
+ . map_err ( TokenError :: from ) ?;
994
994
let source_transfer_amount_hi = proof_context
995
995
. ciphertext_hi
996
996
. try_extract_ciphertext ( 0 )
997
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
997
+ . map_err ( TokenError :: from ) ?;
998
998
999
999
let new_source_available_balance = ciphertext_arithmetic:: subtract_with_lo_hi (
1000
1000
& confidential_transfer_account. available_balance ,
@@ -1053,11 +1053,11 @@ fn process_destination_for_transfer_with_fee(
1053
1053
let destination_transfer_amount_lo = proof_context
1054
1054
. ciphertext_lo
1055
1055
. try_extract_ciphertext ( 1 )
1056
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1056
+ . map_err ( TokenError :: from ) ?;
1057
1057
let destination_transfer_amount_hi = proof_context
1058
1058
. ciphertext_hi
1059
1059
. try_extract_ciphertext ( 1 )
1060
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1060
+ . map_err ( TokenError :: from ) ?;
1061
1061
1062
1062
destination_confidential_transfer_account. pending_balance_lo = ciphertext_arithmetic:: add (
1063
1063
& destination_confidential_transfer_account. pending_balance_lo ,
@@ -1080,11 +1080,11 @@ fn process_destination_for_transfer_with_fee(
1080
1080
let destination_fee_lo = proof_context
1081
1081
. fee_ciphertext_lo
1082
1082
. try_extract_ciphertext ( 0 )
1083
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1083
+ . map_err ( TokenError :: from ) ?;
1084
1084
let destination_fee_hi = proof_context
1085
1085
. fee_ciphertext_hi
1086
1086
. try_extract_ciphertext ( 0 )
1087
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1087
+ . map_err ( TokenError :: from ) ?;
1088
1088
1089
1089
// Subtract the fee amount from the destination pending balance
1090
1090
destination_confidential_transfer_account. pending_balance_lo =
@@ -1105,11 +1105,11 @@ fn process_destination_for_transfer_with_fee(
1105
1105
let withdraw_withheld_authority_fee_lo = proof_context
1106
1106
. fee_ciphertext_lo
1107
1107
. try_extract_ciphertext ( 1 )
1108
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1108
+ . map_err ( TokenError :: from ) ?;
1109
1109
let withdraw_withheld_authority_fee_hi = proof_context
1110
1110
. fee_ciphertext_hi
1111
1111
. try_extract_ciphertext ( 1 )
1112
- . map_err ( |e| -> TokenError { e . into ( ) } ) ?;
1112
+ . map_err ( TokenError :: from ) ?;
1113
1113
1114
1114
let destination_confidential_transfer_fee_amount =
1115
1115
destination_token_account. get_extension_mut :: < ConfidentialTransferFeeAmount > ( ) ?;
0 commit comments