lang: Add Box<T> implementation for the AccountsClose trait
-use crate::{Accounts, AccountsExit, ToAccountInfos, ToAccountMetas};
+use crate::{Accounts, AccountsClose, AccountsExit, ToAccountInfos, ToAccountMetas};
use solana_program::account_info::AccountInfo;
use solana_program::entrypoint::ProgramResult;
use solana_program::instruction::AccountMeta;
@@ -33,3 +33,9 @@ impl<T: ToAccountMetas> ToAccountMetas for Box<T> {
T::to_account_metas(self, is_signer)
}
}
+
+impl<'info, T: AccountsClose<'info>> AccountsClose<'info> for Box<T> {
+ fn close(&self, sol_destination: AccountInfo<'info>) -> ProgramResult {
+ T::close(self, sol_destination)
+ }
+}
