checked_sub_lamports with unwrap (#16922)

* checked_sub_lamports with unwrap

* avoid unwrap
This commit is contained in:
Jeff Washington (jwash) 2021-04-29 15:04:28 -05:00 committed by GitHub
parent 8c651d2530
commit 63c56b57a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ impl RentCollector {
1
},
);
account.lamports -= rent_due;
let _ = account.checked_sub_lamports(rent_due); // will not fail. We check above.
rent_due
} else {
let rent_charged = account.lamports();