File tree Expand file tree Collapse file tree
pinocchio/program/src/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,15 +20,13 @@ pub fn process_sync_native(accounts: &[AccountInfo]) -> ProgramResult {
2020
2121 check_account_owner ( native_account_info) ?;
2222
23- let rent_exempt_reserve = if remaining. is_empty ( ) {
24- Rent :: get ( ) ?. minimum_balance ( native_account_info. data_len ( ) )
25- } else {
26- // SAFETY: `remaining` is guaranteed to not be empty.
27- let rent_sysvar_info = unsafe { remaining. get_unchecked ( 0 ) } ;
23+ let rent_exempt_reserve = if let Some ( rent_sysvar_info) = remaining. first ( ) {
2824 // SAFETY: single immutable borrow to `rent_sysvar_info`; account ID and length
2925 // are checked by `from_account_info_unchecked`.
3026 let rent = unsafe { Rent :: from_account_info_unchecked ( rent_sysvar_info) ? } ;
3127 rent. minimum_balance ( native_account_info. data_len ( ) )
28+ } else {
29+ Rent :: get ( ) ?. minimum_balance ( native_account_info. data_len ( ) )
3230 } ;
3331
3432 // SAFETY: single mutable borrow to `native_account_info` account data and
You can’t perform that action at this time.
0 commit comments