From 63c56b57a9669a147c2e32c0a6990c4dbe5cdd9e Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Thu, 29 Apr 2021 15:04:28 -0500 Subject: [PATCH] checked_sub_lamports with unwrap (#16922) * checked_sub_lamports with unwrap * avoid unwrap --- runtime/src/rent_collector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/rent_collector.rs b/runtime/src/rent_collector.rs index 3aecf3f274..5d1d8dcd7f 100644 --- a/runtime/src/rent_collector.rs +++ b/runtime/src/rent_collector.rs @@ -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();